Rigidbody flips while jumping,problem while jumping with a rigidbody
I'm new to Unity and I've been trying to do a car that moves with wheelcolliders and I make it jump with Add.Force i Vector3.up. The problem is that whenever I'm moving with the car and I turn and jump at the same time, the car flips and starts spinning in the air. Here's my jumpScript:
void Update () { if (isGrounded) { if (Input.GetButtonDown ("Jump") ) {
rb.AddForce(Vector3.up * jumpValue, ForceMode.Impulse);
}
}
}
The way I make the car move fordward/backward is adding motorTorque to the wheels. For turning, I change the steer.Angle of the front wheels.
Any ideas in order to make the car jump without flipping to the sides? I don't want its rotation to be affected by the force.
Thank you in advance :)
Your answer
Follow this Question
Related Questions
Ball control like kula world 2 Answers
How to prevent AddForce from stacking up ? 1 Answer
Rigidbody falls very slowly when movement force is applied 0 Answers
Unity 5 poor game startup load times on mobile/tablet 0 Answers
Can't solve these errors CS0246 0 Answers