Jumping problem.
ap1337
Member Posts: 5
Hi, I'm creating a game, and I want my character to jump. My character is jumping and falling down again. But I want him to stop at my platform. What I've tried is that when my character is colliding with my platform it will change the velocity to 0. But since I have gravity on 300, the character is still going down when it collides with my platform. What can I do to fix this? And also to prevent it to jump while it's in the air. Thankfull for all answers
Comments
To make it stop at the platform, use a "collide" rule. Make sure the restitution attribute of the platform AND of the player is set to 0, or else the player will bounce. Make sure that the platform is not movable too.
To prevent it from jumping while in the air, you can put the jump rules under another rule, like "if motion Y is 0" (that way it doesn't really work, cause there is a moment when the player motion is to 0 even while in the air), or "if player is colliding with platform".