Flying Tank problem

Hi,

I made a simple tank 3D model and a simple controller script for it:

public class TankScript : MonoBehaviour {

	public float speed = 10.0F;
	public float rotationSpeed = 100.0F;


	void FixedUpdate() {

		float translation = Input.GetAxis("Vertical") * speed *-1;
		float rotation = Input.GetAxis("Horizontal") * rotationSpeed;
		translation *= Time.deltaTime;
		rotation *= Time.deltaTime;
		transform.Translate(translation, 0, 0);
		transform.Rotate(0, rotation, 0);

	}

	
}

I gave the tank model a rigidbody and placed the tank on my terrain.
My problem is, that the tank is starting to fly if it is driving over a small hill. It jumps and flys a long distance.

I tried to give it a really high mass, but that doesn’t help.
So, what can I do to avoid that problem?

thanks in advance
Frank

You should really use rigidbody.addforce on the tank instead of modifying its transform. Anything with a non-kinematic rigidbody doesn’t work well with non-instantaneous transform changes. Note that you may have to increase addforce to some pretty high values and then play around with it to get the right speed. Also, your tank will still be able to fly if it’s going too fast, but this will be physically realistic.