Newbie: Make it fly

(numaQ) #1

Hi people !

What is the secret formula to make an object fly ?
I mean i press the UPArrow key and the object move on the Z axis
and STAY in this position.
(and only if i press the downArrow key, the object move down to the floor).

(gargola) #2

make the character or the object you want to move.then go to the realtime buttons.don’t make the object or character dinamic.then add a sensor,controller and actuator.for the sensor make it a keyboard sensor and press the key you want to make the object go up.leave the controller like that and for the actuator set it to a motion the dloc field place the a number like 10 or so…like you want the “p” key and see if your object goes up when you press the key.then do the same for a a down key and make it go down. that shold do it.hope it helps! :smiley:

(numaQ) #3

Thanks Gargola ! :smiley:
That’s exactly what i was looking for.
But now (hum) how can i make it land (or bump) on the floor ?
(without dynamics, my object is going through the ground…)

I use publisher 2.25.

(gorgan_almi) #4

you could turn dynamics back on again and use a Z axis force to make the obect fly up.

In theory you should be able to use a constant upwards force equal to the gravitational force in the world options to counteract gravity, and then use the dx or extra force as before. Thats the theory, but it depends on how acurately the physics engine calculates the forces.

You could always set gravity to zero but that will affect all dynamic objects in the scene.