Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

What does "Exit" do in the Animator Controller? (Beginner level)

Discussion in 'Animation' started by bdilloughery, Oct 3, 2017.

  1. bdilloughery


    Jun 19, 2017
    "Exit" is a hard word to search for. I have been looking through the Unity documentation and reading misc forum posts for awhile, but all of the exit animation posts I find are way more advanced.

    I understand that "Entry" is the default entry leading to the default animation.
    I understand that "Any State" is a shortcut to make a single transition (such as jumping or firing) that can occur from any other animation state.

    What does the "Exit" do?

    Is it ...
    Like the opposite of "Any State"? So I could have "Any State" start the jumping animation no matter what animation was currently running, then just have it go to "Exit" when the boolean "jumping" is false? Would that smoothly transition into the other animations?

    Is it ...
    Some kind of default exit-level animation? Like a last thing to play upon exit?

    ... or something else I'm not even thinking of?
  2. spidermanpc


    Jan 30, 2018
  3. SirJustice


    Jun 12, 2018
    Replying in 2018 :p

    Well I just tried it out and found that "Exit" just exits the transition to start from "Entry" again.

    To make it simple suppose your transition ends in state "blablabla" try drawing a transition from "blablabla" to "Entry".
    You just can't.
    Now If you really need to do that then that is when you use "Exit".
    UnaiLz, quangtqag and schinois like this.
  4. stevensrmiller


    Oct 20, 2017
    It will also take you out of a sub-state machine back to its parent state machine, without requiring that you select a new state to transition into within that parent. That's a bit different from the "(Up) Base Layer" state in your sub-state machine, because transitioning into that will require you to specify a state (or sub-state machine) in your parent. Unity will then add that transition in the parent state machine graph.

    However, if you aren't using it in a sub-state machine, or there is no transition out of your sub-state machine in the parent machine, transitioning into "Exit" does, apparently, cause the parent machine to transition to "Entry," effectively looping, not exiting. This is pretty surprising, considering that the link spidermanpc provided is to documentation that says this:
    I have a pretty hard time making "should exit" mean "re-enter," but that's what it's doing. If you want your animation to just stop, I guess you just never transition out of the final node.