StairsSteppingBody3D

by vissa

8

StairsSteppingBody3D

CharacterBody3D that automatically controlls movement up and down the stairs

How to use

  • Set PLAYER_COLLIDER to whichever collider you want your body to use.
  • Set velocity every physical frame to whatever value you wish to move;
  • Don't forget to call super(delta) at the start of _physics_process if you are overriding it.
  • Don't call move_and_slide() in your character controller, as the class calls it on it's own when calculating stair stepping.

Credits

Most of the code in this addon has been forked from other projects. Check out full list for more:

Notes:

  1. All shape colliders are supported. But Capsule colliders are recommended for enemies
    due to its compatibility with the Navigation Meshes. Its up to you what shape you want to use
    for players.

  2. To adjust the step-up/down height, just change the MAX_STEP_UP/MAX_STEP_DOWN.

  3. This uses Jolt Physics as the default Godot Physics has a few bugs:

    • Small gaps that you should be able to fit through both ways will block you in Godot Physics.
      You can see this demonstrated with the floating boxes in front of the big stairs.
    • Walking into some objects may push the player downward by a small amount which causes
      jittering and causes the floor to be detected as a step.

TLDR: This still works with default Godot Physics, although it feels a lot better in Jolt Physics.

Version

1.0.2

Engine

4.3

Category

Scripts

Download

Version1.0.2
Download Now

Support

If you need help or have questions about this plugin, please contact the author.

Contact Author