Page 3 of 3
Re: Adding sound effect to response menu
Posted: Tue Sep 27, 2022 3:50 am
by Mournsey
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.
Re: Adding sound effect to response menu
Posted: Tue Sep 27, 2022 9:44 am
by Tony Li
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.)
Re: Adding sound effect to response menu
Posted: Mon Oct 10, 2022 9:28 am
by Mournsey
Hi there, thank you so much for the reply!
This worked, thank you kindly! I really appreciate the help!
Re: Adding sound effect to response menu
Posted: Mon Oct 10, 2022 10:23 am
by Tony Li
Happy to help!
Re: Adding sound effect to response menu
Posted: Wed Oct 18, 2023 5:38 pm
by duolazhang
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.)