I'm trying to create android app that makes use of the accelerometer, to do so I'm using this script:
#pragma strict
function Update ()
{
transform.Translate(Input.acceleration.x, 0, -Input.acceleration.z);
}
in this way, the controlled object moves back and forth to the right and left, but I want to move only left and right. how can I fix it?
↧