Hello again.
I am having some issues with AC sound. I set up several sounds using the
Sound script with
Audio Source.
I am using some code to manage which sound to play with what intensity:
x.audio.ChangeRelativeVolume(0f);
x.audio.Play(true);
My issue is following: When I enter play mode from another scene and switch to this one with sounds, they won't work/play. But if I start Play mode from this scene everything works fine.
I first thought that Unity has a bug so I set up a PlayOnAwak sound but this one works fine.
Am I doing something wrong? Thanks for any help in advance!
Comments
I can't use Actions here since I need the Update function and set volumes accordingly.
I also checked in code if .Play gets called on Awake, and it does, so I really have no other idea.
What other information would you need to have more insight on this issue?
PS. Unity version is 2018.1.6f1, AC: 1.63.2(latest)
Edit: I first had that code snippet in Awake() but I now put it in Start() because I thought that AC isn't initialized in Awake yet. Sadly, no changes.
Also, Play on Awake is off for all Sound objects
Maybe another clue: those sounds are played for a few frames at the beginning, probably because ChangeRelativeVolume(0f) doesn't kick in right away after .Play().
Now when I enter this scene from another one, this doesn't happen.