Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Animation is taking too much time to start playing

Discussion in 'Animation' started by cavf, Jan 17, 2017.

  1. cavf

    cavf

    Joined:
    Jan 17, 2017
    Posts:
    2
    I have a animation controller with an aim animation and a bool "firing" parameter. In the script I set the parameter to true if the user clicks the right mouse button, which triggers the animation. The problem is that after the click, the animation is taking too much time to start playing (from one second to 3 seconds, some times). I tried to move the code to LateUpdate and FixedUpdate, with no improvement. Is there a way to make the animation play immediately after the click? (I'm using Final IK to control the character)
     
    TusharVaid30 likes this.
  2. PGJ

    PGJ

    Joined:
    Jan 21, 2014
    Posts:
    899
    Is another animation running when you set your bool? Could this animation have an Exit Time? Then it will play all the way through until a state change can occur. Also, set Fixed Duration and Transit Duration to zero. Then your firing animation should be able to interrupt the animation that is playing immediately.
     
  3. cavf

    cavf

    Joined:
    Jan 17, 2017
    Posts:
    2
    The "Exit Time" was interfering with the transition from one animation to another. Unchecking it solved the problem. Thank you for the reply.
     
    TusharVaid30 likes this.