The request
“Draw a player-character state machine with idle, moving, attacking, dodging, jumping and hurt states inside an alive state, plus a death state when health reaches zero.”
Then tryAdd a blocking state from idle and moving.Change the dodge trigger to consume stamina.
What is in this drawing
Read the decisions behind it.
01
Using a composite state 'Alive' to group all active states enables a single transition to Death from any state when health reaches zero.
02
Input-driven transitions (move_input, attack_input, dodge_input, jump_input) ensure immediate player control responsiveness.
03
The Hurt state provides a damage feedback loop, preventing rapid repeated damage before returning to Idle.
Use this state machine template when designing a reactive player character for 2D/3D action games, platformers, or fighting games where the player can move, attack, dodge, and jump, with health-based death.
More like this