What would be the best way to make a character jump? Like the way I always do it the guy bounces when he lands and if you press the button again in the air he starts going up again. So I am wonseing how to make the guy jump only as long as you hold the button down, and when you release it the guy falls back down.
Keyboard Sensor + Touch Sensor = Love.
Then just set upwards motion? Or what?
Upward force of 100 or so only when keyboard AND touch are positive.
Ok cool thanks a LOT.
One quick thing, though. You should have a material for the floor, with the touch sensor set for that material. Otherwise you’ll become rocketman if you’re touching a wall.
But with material, I can’t have the texture show, so I set a collision with ground property. It works the same.
No it wont work the same. I think the Touch sensor just checks on the -z axis while the collision sensor checks on all axis. You can have a texture with a material. Just add a texture to the material and the UV mapped texture will show up
Ok well would it still work the same just for ground? Then I’ll use the touch sensor for buildings and stuff.
Check the FPS template in
Ok thanks everyone.
Better to use a ray sensor. Send a ray alog the -Z axis, if it hits somthing directly underneth your carector then the sensor gets activated. Easier than using touch sensor and its more acurate. Ex: SpaceKey AND Ray = Player Jump
Oh ok cool thanks.
if you have a material yu can still have texture show… i think
just click the texface box in material settings…
but i agree with that haze, using ray would be much less effort if your going to
have things like steps or a bin or sumthing that you could jump of aswell + more
realisric and you dont have to set the material to everything you can jump off