Jumping in Panda3D[Solved]

Well, think about what a jump involves: when you jump, you push off the ground suddenly. You then move up into the air; all the while gravity accelerates you downwards, until your speed is directed towards the ground. This results in you falling–until you hit the ground, stop falling, and the jump is over.

Looking at your code, right now you’re handling the “gravity” part of that: you’re altering the jump-speed over time. The rest is yet to be added!

On a technical side, your task likely won’t work properly, as you’re not returning one of the expected values in it. You also don’t seem to have a means of stopping the “jumping task” once its purpose is done, or of preventing multiple presses of the space-bar from causing multiple jumps in mid-air.