Jump once even if the key is pressed

I want the jump key to work only when the player is touching the ground and not when it is in the air.Please help

The character controller with the character motion actuator can do this. You can also use its Python API: http://www.blender.org/documentation/blender_python_api_2_66_4/bge.types.KX_CharacterWrapper.html

just add a colision or touch sensor to the controller (make sure it is set to be an ‘and’ controller)

thanks…i added a keyboard sensor…added a motion actuator(motion type:character)…turned “JUMP” active ! made the physics type to character and added a BOX collisions bounds…and its working fine !

100% logic based method

Collision Sensor Property “Map”-------------------and--------Property actuator Jump = 1
Property Sensor if Jump = 0----------------------------------------/

Property Sensor if Jump = Lift-off frame of animation ----and-------Motion actuator Apply Force

Property Sensor interval if jump = 1-(number of frames in jump animation-1)–Property actuator Add -> Jump=Jump+1

Property Sensor if Jump = (number of frames in jump animation)--------Property actuator Jump=0


this will allow for “wall” jumping, only if they are far enough to play your whole jumping animation