A simple to use class that enables your CharacterBody3D to handle stairs properly.
Mainly tested with the Jolt physics engine and cylinder colliders, not guaranteed to work well with anything else - but try it!
- Make your character controller extend
StairsCharacterinstead ofCharacterBody3D. - Ensure your character's collider is named 'Collider'.
- Every frame, set
desired_velocityto the desired direction of movement. - Call
move_and_stair_step()instead of callingmove_and_slide(). - Done!