- Home /
Playerobject makes weird "jump"
Hi there,
sorry for the title but what actually happens is really weird.
I got the following script:
float jump = Input.GetAxis("Jump"); plr.Translate(0, jump * Time.deltaTime,0);
(inside the update function of course)
The funny thing is, that it doesn't really jumps. Even if I add a multiplier it does not make the same "move". I am testing with a Sphere to get the simpliest model.
Sometimes it jumps but instantly falls downwards, like a stone into water, and often it just bumps from ground for a second. Looks really weird to me.
Answer by Proclyon · Nov 19, 2010 at 02:33 PM
That's because a jump is actually a composition of forces. Gravity versus upward force versus upward momentum versus drag.
To make that english
Use the Move function and you should be ok. It also checks for collisions for you. The problem with adding vertical values is that they don't have an over time slow down period while going up making it look uncanningly unrealistic.
For a reference for the move function check here:
Yammie, now my sphere doesn't roll anymore it just moves. Well this doesn't really solved the whole problem^^
plus it kills the physics, no use of real gravity etc. and my game is basically about a ball rolling down the hill, and if he does not roll or show any sign of "physics" it s kinda pointless =)
Yeah move is more for character controls. Was afraid this could happen. Applying Gravity to character controls seems to be the envi gravity or the home grown one. I'm guessing what u need is pure physics. No more or less. Stick to fiddling with 2 rigidbodies. Everything else consider it useless tripe. And you should have at least some use for my less than usefull answer
Yesterday I experimented with "Forces" ins$$anonymous$$d of "Translate", this perfectly works. Thank you for the help, finally I find a solution by my self. I ll post the solution updwards