-
Notifications
You must be signed in to change notification settings - Fork 10
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
Jseb #26
Jseb #26
Conversation
… velocity to be applied: the player would be falling until be stopped by an obstacle.
I'm not convinced that this is the best way to approach this problem. There are cases when gravity is 0 and you still want vertical movement, perhaps in a sci-fi game which switches between a simulated gravity and no gravity. I would recommend that you set vertical velocity to 0 on the first frame when you detect a collision with the ladder. |
I think that wouldn't prevent vertical movements, but only unwanted fall. The issue i've encountered is when climbing a bit above the top of a ladder:
May be there is a better solution, but honestly i have searched two days before modifying the engine. |
I did an update on the master branch and added an example of ladders to the Grotto Escape sample. Please have a look and let me know what you think! |
Thank for for having took time to look this issue. Ok i've looked the new sample: - player cannot go beyond the top of the ladder or he falls. + the player can stop his fall when falling from a ladder, by moving up. So IMHO the advantages and drawback are balanced. Just a question,about the change you've done in
why replacing |
I set the velocity to 0 when climbing and if you climb down and reach the ground it is important that ground contact is detect even when the velocity is 0 |
I had an issue when climbing a ladder : i'm using a special group for ladders, which doesn't block player. When the player is on the ladder, gravity is set to zero. This way player can go up and down on the ladder.
But when arrived at the top of the ladder, if the player continues it will hit empty space, and gravity is set again to normal value. So the player begins to fall. When he hits again the ladder group, the gravity is set to zero again, but the fall continues until the player has reached the ground or a stopping obstacle.
That's why i've added a test for gravity in the computing of the Y velocity.