- Home /
Best way to make precise and exact jumps all time
What would be the way to make the rigidbody jumps perfectly same all the time ? In my project the space around the platforms would be empty so if the jumps are not precise and same I cannot design levels as the players would fall off inevitably.
So what would you suggest : AddForce() or velocity = new Vector3() or MovePosition or some other function ?
If you're using a rigidbody, it's simply a matter of using the function correctly rather than choosing which one to use.
Alright so since I am using a AddForce already to give the rigidbody its forward speed, what would be the correct use of correct function ?
You just need to make sure that the velocity change caused by your call to AddForce
is always the same.
The jump and the landing are two different problems. Don't look for a solution for one in the other. It's completely impossible to answer your question more precisely than I already have, so if you want actual help, post more information as to your problem. Otherwise you can close the question.
You might get away with setting the velocity to zero when you collide with the platform.
void OnCollisionEnter(Collision other)
{
rigidbody.velocity = Vector3.zero;
}
Your answer
Follow this Question
Related Questions
Rigidbody AddForce Up - different value. 1 Answer
rigidbody.Addforce the force doesnt apply? 1 Answer
Keep Horizontal Momentum after Jump 2 Answers
How do I make my character jump? 1 Answer