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. Join us on Dec 8, 2022, between 7 am & 7 pm EST, in the DOTS Dev Blitz Day 2022 - Q&A forum, Discord, and Unity3D Subreddit to learn more about DOTS directly from the Unity Developers.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Loop animation x times before transition

Discussion in 'Animation' started by stevej91, Jun 6, 2021.

  1. stevej91

    stevej91

    Joined:
    Apr 1, 2019
    Posts:
    2
    Hi,

    New to the animator and here's what I'd like help doing. I want to play an idle animation several loops and then play a separate charismatic idle and revert back every so many seconds. How do I keep one animation on loop until x seconds passes to play the other animation once and come back?

    Thank you if anyone is willing to answer.
     
  2. Olmi

    Olmi

    Joined:
    Nov 29, 2012
    Posts:
    1,491
    Hi,

    Write a logic in code that switches your animation state.

    Check animator documentation to see how you could set booleans and triggers to switch animation. Then just create a logic which plays N times an animation, then performs another animation.