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

How can I make the default state the end state of an animation clip?

Discussion in 'Animation' started by Reshima, Jun 23, 2020.

  1. Reshima

    Reshima

    Joined:
    Dec 10, 2012
    Posts:
    51
    I have a simple UI control (Toggle) where I animate the "on" and "off" states.

    upload_2020-6-23_14-58-35.png

    I have 2 anim clips:
    1. From On to Off
    2. From Off to On
    I have 3 states in my anim controller:
    1. Default (no motion)
    2. UIToggle_On (off to on clip)
    3. UIToggle_Off (on to off clip)
    I control the transitions using a boolean param called "isOn".

    What I want: Set the initial default state without playing any animation at all.

    How can I do this?
     
  2. elliotfriesen

    elliotfriesen

    Joined:
    Mar 17, 2020
    Posts:
    71
    Default states play automatically if that’s what your asking?
     
  3. Reshima

    Reshima

    Joined:
    Dec 10, 2012
    Posts:
    51
    No, my ask is if it's possible to set the default state to be the end frame of an animation clip. I don't want the animation to play, I want it to be at its default end state.

    Imagine if this was a character death animation. You want to spawn a character already dead instead of playing the death animation. You want by default the animation state to be the end state of the death animation. Does it make sense?
     
  4. Reshima

    Reshima

    Joined:
    Dec 10, 2012
    Posts:
    51
    Nevermind, I figured it out. I had to set the "Motion time" param in the animation state to 0 or 1.
     
    Masdox33 likes this.
  5. TimmyTheTerrible

    TimmyTheTerrible

    Joined:
    Feb 18, 2017
    Posts:
    186
    another way would be to make the default state empty containing no animation clip at all.
     
    Masdox33 likes this.