Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: How to make a character climb a ladder? #109

Open
elisherer opened this issue Sep 29, 2024 · 1 comment
Open

Question: How to make a character climb a ladder? #109

elisherer opened this issue Sep 29, 2024 · 1 comment

Comments

@elisherer
Copy link

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!

@hichemfantar
Copy link

hichemfantar commented Oct 6, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants