This is my code for a block to move with the accelerometer, but it think its not smooth enough, how could i change it?
void MoveLeft ()
{
transform.Translate(Vector3.left * Time.deltaTime * VelocityCube, Space.World);
}
void MoveRight ()
{
transform.Translate(Vector3.right * Time.deltaTime * VelocityCube, Space.World);
}
void Accelerometer ()
{
float x = Input.acceleration.x;
if (x < -0.1f) {
MoveLeft ();
} else if (x > 0.1f) {
MoveRight ();
}
}
void FixedUpdate ()
{
Accelerometer ();
}