ecctrl icon indicating copy to clipboard operation
ecctrl copied to clipboard

Question: How to make a character climb a ladder?

Open elisherer opened this issue 1 year ago • 1 comments

I'm making a 3d game and trying to figure out how to make my character to climb a ladder using this library.

I wish to have it working "Minecraft" style, walking into the ladder should make me "walk" up. I realize I need a collider that will change some of the physics when entering it and exiting it ("while on ladder") but after playing for a while with the options, I couldn't figure it out.

Has anybody tried it? have an example? Thanks!

elisherer avatar Sep 29 '24 13:09 elisherer

i suppose this package could use isFlying and isClimbing states.

in the most basic implementation, you just add a sensor collider to the ladder, when the player enters the ladder sensor then you disable gravity. when the player exists the collider, you restore gravity.

take a look at this if you're willing to dig into the source code yourself https://www.youtube.com/watch?v=cIZaqeJd28Y

clicktodev avatar Oct 06 '24 14:10 clicktodev