Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Audio play sound with animation in sequence

Discussion in 'Audio & Video' started by Tharmine02, Apr 6, 2017.

  1. Tharmine02

    Tharmine02

    Joined:
    May 5, 2014
    Posts:
    25
    Hi all,

    I must be doind somethong wrong.
    I have an animation with multiple objets and I want to play a sound with it. I added the sound to the animation, and enable/disable it using keyframes.
    It plays fine the first time. But if I loop the animation (not the sound) the sound is not played again (while the rest of the animation is).
    I do not want to enable the loop on the sound as it is not the same lenght as the animation. But I want the sound to be played each time the animation start.
    How can I do that outside code and in the animation window?
    many thanks in advance,
    Thomas
     
  2. Tharmine02

    Tharmine02

    Joined:
    May 5, 2014
    Posts:
    25
    apparently, enabling it at the beginning and desabling it one keyframe before the end of the animation does the trick...
     
    Hattoriseed likes this.