Forum rules - please read before posting.

Toggle's *ActionList on click* runs when the options menu opens.

Unity 6000.0.21f
AC 1.81.7

Hi. I need to play one sound when the subtitles are toggled On and another sound when they are toggled Off in the options menu. And I also need to change a Speech Manager variable depending on the toggle value.
So the toggle type is Variable linked to a global variable. I added an Action List where I check for variable and play the corresponding sounds and actions.
When I click on the toggle everything works as expected.
The problem is if I close the game when the toggle value is Off and run the game again, the first time I open the options menu, the Off sound plays automatically.

I opened a new unity project, new AC import and the problem remains. Here are the few steps to reproduce this:
1) In a new AC scene, go to Variables Manager and add a new bool Global Variable, I call it options_subtitles, set Link to: Options Data.
2) Go to Menu Manager. Change the Options menu Source to Unity Ui Prefab.
3) In the Subtitles element, set Toggle type: Variable, global Boolean var: options_subtitles and add an actionList on click.
4) In the action list add a variable check global action. If true, play a sound if false play another sound (play one shot or Play is the same)
5) Run the game, click on the option's subtitle element, leave Off. Re-run the game open the options menu, the sound plays automatically.

I'd appreciate any guide on how to avoid this. I'd like the sounds to play only when I press the toggle.
I also created a default button to restore options values. Subtitles default value is On.
When I click the default button, the toggle sound plays too, even though I have not clicked on the toggle element.

Comments

  • Thanks for the steps, I'll attempt a recreation.

    To be clear: there's no audio assigned in the Toggle element's "Click sound" - only in the Sound Action?

  • Correct. Only in the sound actions.

  • Recreated, thanks.

    I'll see that this is fixed for v1.82 - you're welcome to PM me if you'd like to be involved in testing.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.