“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?
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”.
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.
Thanks for asking here and for the replies. I just made a transition to that Exit state and wasn’t sure if it was doing something I don’t know and would mess things up. I did it to consume a potential queued trigger that I couldn’t find a better solution with the time I have.
All these years later, ha.