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

Don't stop current animation to play next animation

Discussion in 'Animation' started by Corva-Nocta, Feb 10, 2016.

  1. Corva-Nocta

    Corva-Nocta

    Joined:
    Feb 7, 2013
    Posts:
    801
    I'm trying to create a combat system where 1 animation plays then if the player hits the attack button while the animation is playing the next animation in the sequence will play. My problem is that if I hit the attack button it will immediately stop the current animation and play the next animation. Is there a way to stop the second animation from playing until the first animation is done? I tried to mess with queued but that didn't quite work, maybe I was doing it wrong. Any help would be great!
     
  2. jctz

    jctz

    Joined:
    Aug 14, 2013
    Posts:
    47
    Are you using mechanim with an animation state machine? If so, just make sure the transition has 'Exit Time' enabled, and then set an Exit Time late enough in the clip. This will make it so the original animation has to reach the specified exit time before it can transition out.
     
    theANMATOR2b likes this.