- Home /
Object with rigibody bouncing all over the terrain when moving
I have a terrain that's about flat but has some light bumps. I have an object with a rigibody that I move using a basic script:
float forwardThrust = Input.GetAxis("Vertical") * thrust;
rb.AddForce(transform.forward * forwardThrust);
float turningTorque = Input.GetAxis("Horizontal") * torque;
rb.AddTorque(transform.up * turningTorque);
It works ok for the most part, but one issue is as it picks up even reasonable speed it starts bouncing all over the place uncontrollably. I set the weight to 1000, and physics materials on both the terrain and the object have bounce=0. I can't figure out what I'm missing. I want the object to glide along on the terrain and quit bouncing.
Comment
Best Answer
Answer by hexagonius · Mar 27, 2015 at 05:27 PM
You could set velocity.y of the object's Rigidbody to a negative constant in FixedUpdate()
Bleh. Such a simple solution to such an annoying problem. I can't believe I didn't think of that. Awesome. Thank you.