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. Dismiss Notice

Setting animation loop end points

Discussion in 'Animation' started by itierney, Sep 4, 2020.

  1. itierney

    itierney

    Joined:
    Jan 28, 2019
    Posts:
    27
    I want to set arbitrary loop points within an animation. So for example, if my animation is 10 seconds long I might want to loop from 8 to 9 seconds in.
    When I set a loop, I see a "Cycle offset", which allows me to set where the loop starts but not where it ends and even that goes back to the start for the next loop.

    I've also searched the docs and found this:article but I cant seem to find the window it refers to.

    Thanks!
     
  2. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
  3. itierney

    itierney

    Joined:
    Jan 28, 2019
    Posts:
    27
    I can simply do this in the state update. However if it keeps re-entering "OnStateEnter()"
    Which seems wrong because you are already in that state.
    if(stateInfo.normalizedTime >= 0.92f )
    animator.Play("STATE", 0, 0.71f);