Search Unity

Question Reset Track via Audio Mixer

Discussion in 'Audio & Video' started by KarlKarl2000, Jul 11, 2020.

  1. KarlKarl2000

    KarlKarl2000

    Joined:
    Jan 25, 2016
    Posts:
    606
    ***UPDATE***
    Found the solution for those looking in the future. When you PLAY your audiosource, it automatically resets to the start!

    https://docs.unity3d.com/ScriptReference/AudioSource.Play.html
    ***UPDATE***





    Hi @Domas_L , @michaelberg , @Matthew-Schell

    I'm a bit lost reading the API documents.
    https://docs.unity3d.com/ScriptReference/Audio.AudioMixer.html

    Is there a way to restart a Snapshot ?

    For example:

    Start:
    -> SnapshotA(Volume 0)
    -> Snapshot B(Volume -80).

    Goal:
    -> SnapshotA(Volume -80)
    -> Snapshot B(Volume 0).
    -> Restart Snapshot B's song so it starts from the beginning.


    Code (CSharp):
    1.  SnapShotB.TransitionTo(2.5f);
    Just transitions to SnapShotB , but it's not from the very start of the song.

    Thanks for the help!:)
     
    Last edited: Jul 18, 2020