Loading...
83
1 year 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 new Mario & Luigi game was just announced called Mario & Luigi Brotherhood! What do y'all think? I've never played a Mario & Luigi game.

A brand new Zelda game was just announced!

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

sup dudes im a dolphin ๐Ÿฌ

Our 2024 Advent Calendar has opened! Day 18: @Otis_Le_PoOtis is the Creator of Bondeeโ€™s Barnyard and posts updates about their dev journey and their work on the sequel!) Accept the quest and give them a follow to get Coins and a seasonal sticker!

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

Happy #WIPWednesday!

Are you working on a game?

Making some art?

Practicing a song?

Something else?

Tell us in the comments!

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

It looks like Jagex is about to have its 4th owner in 8 years: CVC Capital Partners is looking to close a $1.1 billion deal to acquire the studio behind RuneScape. ๐Ÿ‘€ They're changing hands about as much as I change my underwear.

https://www.gamedeveloper.com/business/report-investment-firm-cvโ€ฆ

@Miles_Games is a Jolter to Watch! They post great game dev updates about the holiday-themed platformer TEAM SLAY-BELLS! Follow them before the quest ends on December 24 and you'll get Coins!

Here's my coin purse. I'm slowly turning into the weird dude who pays in all gold dollars. ๐Ÿ˜ฌ