0
$\begingroup$

So...

I am making a simplish maze game.

My Issue at the moment is with making the character jump. I have a keyboard sensor for SPACEBAR that when the player presses it, it gives them 0.05 motion upwards.

Well, you keep going upwards until you let go of SPACEBAR, and when you do, you go slamming back down to the ground.

Another thing, you can jump 1. when your in the middle of a jump, or when you have fallen off the edge...

$\endgroup$
2
$\begingroup$

The blender game engine has a special function for jumping: first, make sure the Physics Type for your character is set to "Character". Then, in the Motion actuator, set Motion Type to "Character Motion", leave all the numbers at zero and set the "Jump" button. As the tooltip says, the settings for that are in the Properties panel, Physics tab (right underneath the Physics Type).

If you can't use the Character type for whatever reason, another way to make it work (the old way) is to add a collision sensor that references the ground, then "and" that with your keyboard sensor.

FYI: this seems to be a duplicate of How to create a realistic jump in bge, but since I don't have enough rep to flag it as such, I answered instead.

| improve this answer | |
$\endgroup$
  • $\begingroup$ This would also provide the possibility of multijump, like jumping a secound time before reaching the ground. $\endgroup$ – Quacksilber Jun 25 '17 at 10:43

Not the answer you're looking for? Browse other questions tagged or ask your own question.