Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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

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

  1. bdilloughery

    bdilloughery

    Joined:
    Jun 19, 2017
    Posts:
    16
    "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?
     
    paul-masri-stone likes this.
  2. spidermanpc

    spidermanpc

    Joined:
    Jan 30, 2018
    Posts:
    1
  3. SirJustice

    SirJustice

    Joined:
    Jun 12, 2018
    Posts:
    1
    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".
     
  4. Stevens-R-Miller

    Stevens-R-Miller

    Joined:
    Oct 20, 2017
    Posts:
    676
    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.
     
    maxkcy, detzt, Kokowolo and 15 others like this.
  5. orofbrown

    orofbrown

    Joined:
    Sep 12, 2020
    Posts:
    1
    @sirjustic
    SMH I couldn't figure out why my animation wouldn't stop looping, even with the box unchecked. Thanks for the follow up haha