Skip to content

Latest commit

 

History

History
6 lines (3 loc) · 514 Bytes

File metadata and controls

6 lines (3 loc) · 514 Bytes

Platformer Sample - Rolling

The RollingState allows the character to turn into a rolling ball that can accelerate and has no notion of grounding. In OnStateEnter, the character's grounding evaluation is disabled, the character collider geometry is changed to a sphere, and the character mesh is swapped for a ball mesh. The opposite effect is done in OnStateExit. Velocity is handled simply by accelerating the velocity in the desired direction.

This state is transitioned to by pressing the roll input.