Search Unity

Looping my animation

Discussion in 'Animation' started by IMotion, May 19, 2021.

  1. IMotion

    IMotion

    Joined:
    Jan 20, 2020
    Posts:
    2
    1.png 2.png

    I want to create a nice idle effect on my character. For this I need my animations to continue on and on without stopping. The problem is that the animation stops once it's fully played (1,5 sec).

    Can anyone tell me if it is possible to loop the animations so it will continue until there is interaction.
     

    Attached Files:

    • 1.png
      1.png
      File size:
      211.9 KB
      Views:
      284
    • 2.png
      2.png
      File size:
      228.3 KB
      Views:
      280
  2. Shippety

    Shippety

    Joined:
    May 9, 2014
    Posts:
    31
    The quickest way to do that would be copying your animation state in the animator window and having the current animation lead to that one, and have that animation lead to the current one. Not sure how familiar you are so just to be safe you make a transition by right clicking on the animation state, selecting transition and dragging to the other animation state! Make sure to set the transitions so they don't overlap and clip.

    When you want to interrupt the animation because of an interaction you can make a transition to whatever animation you want to play next that has a boolean conditional (create it in the parameter tab and set it in the transition tab once you make the transition) - it'll only go to the next animation according to the variable, which you can set through code.
     
  3. IMotion

    IMotion

    Joined:
    Jan 20, 2020
    Posts:
    2
    Thanks I will try, makes sense to me. And to answer your question, I am fairly new to this.