Hello guys.
I want to make a script for the control of an aircraft using the acceleromenter.
I wrote these two lines but I do not understand why even if you turn my airplane always continues to go straight in the same direction.
var speed = 2;
var rotateSpeed = 2;
function Update()
{
transform.Rotate((Input.acceleration.x * rotateSpeed), (-Input.acceleration.y * rotateSpeed) ,0);
rigidbody.AddForce(Vector3.forward * speed);
}