Search Unity

Accelerometer on iPhone

Discussion in 'Physics' started by mattdennis, Mar 10, 2015.

  1. mattdennis

    mattdennis

    Joined:
    Mar 4, 2015
    Posts:
    14
    Hello,

    I use this one line of code (c#) for player movement on iPhone;

    transform.Translate (Input.acceleration.x, 0, -Input.acceleration.z);

    When I run it on my game, the player goes strait down unless I turn my upside down.
    I've tweaked the x, y, z many times (to negative or 0 or even dividing it by 2) and still can't get the player movement right.

    Any help would be greatly appreciated.