Hi there, I'm trying to get some audio to play upon button click.
I'm able to get the sound effect to trigger by adding an audio file to the button's 'on click' event but this then disables the buttons function in game.
The sound of the button will trigger but prevents the dialogue from continuing. When I remove the 'On Click' event with audio it works again.
I'm a bit confused why the audio would be stopping the button from continuing the dialogue.
Thanks in advance.
Adding sound effect to response menu
Re: Adding sound effect to response menu
Hi,
Assign the StandardUIResponseButton component's OnClick to the UI Button's OnClick() event in addition to the sound effect. The StandardUIResponseButton will only automatically add its OnClick at runtime if nothing is assigned to the UI Button's OnClick() event. If anything is assigned to OnClick(), it will not auto-assign itself. (This gives designers the option to assign different functionality that doesn't immediately select the response.)
Assign the StandardUIResponseButton component's OnClick to the UI Button's OnClick() event in addition to the sound effect. The StandardUIResponseButton will only automatically add its OnClick at runtime if nothing is assigned to the UI Button's OnClick() event. If anything is assigned to OnClick(), it will not auto-assign itself. (This gives designers the option to assign different functionality that doesn't immediately select the response.)
Re: Adding sound effect to response menu
Hi there, thank you so much for the reply!
This worked, thank you kindly! I really appreciate the help!
This worked, thank you kindly! I really appreciate the help!
Re: Adding sound effect to response menu
Happy to help!
-
- Posts: 10
- Joined: Fri Oct 06, 2023 10:54 am
Re: Adding sound effect to response menu
Encountered the same problem, but your solution resolved it. Thank you!
Tony Li wrote: ↑Tue Sep 27, 2022 9:44 am Hi,
Assign the StandardUIResponseButton component's OnClick to the UI Button's OnClick() event in addition to the sound effect. The StandardUIResponseButton will only automatically add its OnClick at runtime if nothing is assigned to the UI Button's OnClick() event. If anything is assigned to OnClick(), it will not auto-assign itself. (This gives designers the option to assign different functionality that doesn't immediately select the response.)