I have an object with a character physics setting.
Every time I press the mouse button it should set the fall speed of the object to zero and stop it in midair.
I’m able to set the gravity, the only problem is how to set the object’s fall and and jump speed velocity at run time
My code’s like this at the moment
import GameLogic from bge import logic cont = GameLogic.getCurrentController() own = cont.owner controller = bge.constraints.getCharacter(own) object = logic.getCurrentScene().objects obj = object["player_collision_box.001"] #the main object attack = cont.sensors["attack"] #the mouse sensor if attack.positive: controller.gravity = 0 own["Timer"] = 0.000 object.game.fall_speed = 0.0 #doesn't work object.game.jump_speed = 0.0 elif own["Timer"] > 0.4: #Timer property used to set how long gravity stops acting on the object controller.gravity = 9.8