Performs custom actions when a state machine transitions out of this state.
- iOS 9.0+
- macOS 10.11+
- Mac Catalyst 13.0+
- tvOS 9.0+
The state the state machine will transition into to exit this state.
Override this method when the actions you want to perform in response to a state change should be associated with state being exited, or when those actions depend on which state a state machine will enter as a result of the transition.
For example, in a state machine that manages animations for a 3D character, with Standing, Running, and Jumping states, entering the Jumping state might apply an animation to the character (with a smooth transition from the character’s current pose), and exiting the Jumping state could remove that animation (again with a smooth transition).
Or, in a game where each enemy character has Chase, Flee, Dead, and Respawn states, exiting the Flee state when the player attacks an enemy might increase the player’s score, but exiting the Flee state because a timer has expired might not.