multiple jump problem

hi everybody,

I'm making a game in wich the charictar can jump.  To jump i set is so when space is pressed i set the linv for 3 in the third column.  The problem is that once you jump, you can continue to press space and you can make your charictar fly.  is there any way i can make it so you have to be on the ground to jump or have to have hit the ground to be able to jump again?

I’m not up on python yet but i’m thinking allong the lines of when you jump it sets a value to 1 and when you hit the ground it sets the value to 0 and in order to jump that value must be 0 (or <1 whatever)

Give the ground a property called “ground” and then give your character a collision sensor linked to the same controller that your keyboard sensor is connected to. Then type the property name of the ground in property box on the collision sensor.

Is there any way to use logic brics in a way so that when space is pressed it first checks to see if the value of a proporty is say 0, before it goes on to do the action? It seems kind of odd the way blender forces you to use a maximum of 3 steps in logic brick actions.


I just started learning the game engine myself, but if you give the jump command two sensors (one keyboard and one touch) and just set the key, it should work. Connect them both to the AND brick, and then the jump action.
Hope that helps. And here’s a great tutorial:

goldentaiji said:

Ok, hehe it seems I assumed wrong. You might want to take a look at this blender GE document that explains most of the logic bricks in pretty good detail.

Wouldn’t that make it so whenever you hit the ground or press space, you jump? Not make you have to be touching the ground when you press space to jump.

No, that would only happen if you used an “or” controller. The “and” controller makes it so all sensors connected to it have to be true before the action can take place.

Yea, I just tried it and it worked! :smiley: I didn’t know the AND controler was for the sensors, i thought it just ment AND CONTINUE :stuck_out_tongue: I actuly also saw this same setup to jump it the demo for mouse controled camera somebody put out (sorry for not remembering you) and decided to test it and what do ya know, it works! Thanks a lot

No problem. I hate when people don’t answer some easy question for a beginner because they are lazy, so I try to help.