Search Unity

  1. Check out the Unite LA keynote for updates on the Visual Effect Editor, the FPS Sample, ECS, Unity for Film and more! Watch it now!
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  5. Want to see the most recent patch releases? Take a peek at the patch release page.
    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?
     
  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".
     
    quangtqag and schinois like this.
  4. stevensrmiller

    stevensrmiller

    Joined:
    Oct 20, 2017
    Posts:
    34
    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.