Loading...
100
2 years ago

After researching different ways to handle stairs in Godot, I finally got it working last night! It's choppy and probably not the best implementation, but it will suffice for now and let me focus on other things! 😁


For anyone struggling with stairs in Godot, at least in 4.1.1, you can easily fix it by adding another CollisionShape3D to your CharacterBody3D node and use a SeparationRayShape3D as its shape. From there, move the new CollisionShape3D to the height of the step and set its length to the difference between it and the floor and rotate the CollisionShape3D to point it down towards the floor. Make sure if you have another collider on your CharacterBody3D that you move it or shrink it to be just above the new CollisionShape3D.

Basically, if you have a capsule for your player and the floor is -1 from the transform.origin of the player node, set your new CollisionShape3D to whatever the maximum height of your step will be above the floor and the length to that height as well.

It'll pretty much work instantly after that as the SeparationRayShape3D will push your CharacterBody3D up to the level of the step once it collides with it. It makes for a pretty simple way to handle stairs and you should be able to tweak it to how you need it.

I might make an actual tutorial video on how to do this as I have not found just a straightforward example of how this works. We have to share our knowledge so we can all grow and build the games we want to build.



2 comments

Loading...

Next up

A brand new Zelda game was just announced!

The Legend of Zelda: Echoes of Wisdom releases September 26th, 2024! What do you think?!

After several hours of trying to explain how to count to 18, I have a working prototype of a game idea I've had courtesy of Gemini CLI. 😬 Depending on how the testing phase goes, I will be rewriting this myself into a more fleshed out game soon. 🀞

Looks like Humble Bundle is running a bundle on some Blender assets and 3D models. Might be worth a look-see for gamedev and the like?

https://www.humblebundle.com/software/blender-markets-essential-…

@pm-studios ' Bandit Trap has an open beta RIGHT NOW! It's open until 3 am ET on Nov 30th.

Quests celebrating the beta have entered your quest log.

Play the game for FREE: https://bit.ly/BanditTrapSteam

Metroid Prime 4 Beyond trailer was officially revealed during the Nintendo Direct today! What do you think?

πŸ†Meet the winners of the Narrative Jam presented by Game Jolt and @NEOWIZ_QUEST ! Where every story finds its voice!

I think my third-person camera and player controller is done. πŸ‘€ Now I can finally move on to the next functionality to implement!

A new Mario & Luigi game was just announced called Mario & Luigi Brotherhood! What do y'all think? I've never played a Mario & Luigi game.

πŸ₯‰βœ¨ I won 3rd place in the Narrative Jam! ✨πŸ₯‰

My game Luna Magica made it into the winners of the Game Jolt + NEOWIZ jam Γ’wΓ“ They really loved the worldbuilding and the dark magical-girl vibe, πŸŒ™

Thank you so much to everyone who played it! #GameDev #JotaDev

Way to make me feel old, @gamejolt .

Oh who am I kidding? We're all getting old.