hi ,everyone,i just write the code piece as follows:
void Update () {
transform.Translate (Input.acceleration.x*Time.deltaTime*5,
0,
-Input.acceleration.z*Time.deltaTime*5);
}
and i attached it to a cube in my scene.
it works well when i tilted my device along z axis,but it didn’t work when i tilted my mobile along x axis.
so could anyone tell me why?![]()