Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Bug AudioMixer Snapshot TransitionTo does not working

Discussion in 'Audio & Video' started by Ichimitsu, Nov 29, 2021.

  1. Ichimitsu

    Ichimitsu

    Joined:
    Oct 9, 2014
    Posts:
    26
    Unity 2019.4.32 and 2020.3.23

    Audio Mixer snapshot transition does not work in the editor and on Android devices. In the editor, you can see that the snapshot is toggled, but its parameters are not applied. In edit mode, if you switch snapshots, everything works.
     
  2. AlexanderL1

    AlexanderL1

    Joined:
    Feb 21, 2018
    Posts:
    16
    I know that discussion old, but I need answer for future peoples.

    If you use AudioMixer.SetFloat:
    "When a parameter is exposed, it is not controlled by mixer snapshots. You can only change the parameter with this function."

    How to make all works like I wish - I dunno
     
  3. Lonsilon

    Lonsilon

    Joined:
    Oct 26, 2018
    Posts:
    1
    Hello my friend, i had the same problem at 2022.3.7 version and i could fixed it like this:

    Old code
    Code (CSharp):
    1. AudioMixerSnapshot snapshot;
    2. ......
    3. snapshot.TransitionTo(time)
    New code
    Code (CSharp):
    1. AudioMixer _audioMixer;
    2. .....
    3. _audioMixer.TransitionToSnapshots(new[] { snapshot }, new float[] { 1 }, time);
    I hope worth for you and anybody ;)
     
  4. AlexanderL1

    AlexanderL1

    Joined:
    Feb 21, 2018
    Posts:
    16
    Did you use AudioMixer.SetFloat? Its main problem, because I want to allow players change volume & still want use snapshots. I checked code - not work (2021.3.15f1)