Every state a character can be in inherits from the base CharacterState
component. There are several general categories that states fall into:
Category | Description | Usage | Examples |
---|---|---|---|
Idle | The character's default state which they return to automatically after performing an action. | Assigned to the Character.Idle field. |
IdleState LocomotionState WallSlideState |
Action | Something the character can do intentionally. | Referenced by the Character Brain. | JumpState AttackState |
Reaction | Something the character will do automatically in response to a specific event. | Registers itself to be started by the relevant event so generally nothing else needs to reference it directly. | IntroductionState LandState FlinchState |
Special | Multi-State is in a category of its own because it isn't really a state but rather is used to select from a list of other states. | MultiState |
There is no real distinction between those categories in the code, they are just here to help you understand how the various states fit together in a character.
Introduction | A state used for a character to show off when they first spawn. |
Multi-State | A "state selector" which simply picks from a list of other states. |
Idle | The default states characters return to after they finish performing an action. |
Jump | The states used for different kinds of jumping. |
Attack | States used when the character is attacking. |
Flinch | A state used when a character gets hit by an attack. |