Basic question re: Python script and jumping

So I have a small script to control my actor’s movement, and while movement on the XY plane is fine, I wanted it to be able to jump too. So I just added a sensor for the correct key and had it trigger a change in LinV Z. However by default, for pulses where the object isn’t jumping, it has a LinV Z of 0…even when it’s in midair. So if I jumped and continued moving while doing so, I end up ice skating through midair until I stop moving completely. This is because I’m using setLinearVelocity(x,y,z,lg), so I can’t just pass an undeclared value in for z–it has to have something. I think.

Is there a more elegant way to get a smooth, arcing jump, or am I going to have to do something ugly with timers, the world acceleration value and a constantly changing velocity?

Also, and this is embarassing, but where in 2.48 can I find the option to change constants like world acc. due to gravity? I heard it’s just a World button, but the only one I’ve ever seen has been when I apply a material to an object, so that’s obviously not it.

Thanks for any help ya’ll can provide.

There’s a gravity slider in the world tab within materials.

What’s the actual setup of the script? Do you use LinV for all movement? If so, you might need to have LinV set as -9.8 as the base value before the jump is applied.

I have the same problem where I want to disable the jumping action as long as the character is in mid air. What do you suggest?

EDIT: Solved!

Just add a touch sensor, and check for it to be true when pressing the jump button. This is a very basic solution, and still goes to shit when touching a wall, ceiling or basically anything else that should not be possible to use as a support.