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