Using the accelerometer as controller on android.


I am a designer and can program somewhat in Unity, but I’m absolutely new in programming for the mobile. I’m trying to create a FPS game using the accelerometer/gyroscope function as a controller. I looked for any tutorials on this matter, but there aren’t many to almost none. What I want to do is when you are in idle position and move the phone forward on the z-axis, you will automatically walk forward when you reached a certain amount of force forward. Same goes for walking backwards. When you want to go back to idle position, you just the phone the opposite direction. So from walking, move the phone backwards to stand still and vice versa for walking back.

To look up you have to pitch and move the phone up and to look down, you have move your phone down and pitch down.

To rotate to the left with a steady speed happens if you yaw the phone to the left about 20 degrees and rotate right by yawing the phone to the right.

Anyone who could help me with this is much appreciated.

You can measure accelerations, not absolute positions in 3D space.

The Input class provides acceleration events and data.

have you found anything? i know it has been a while, but i am trying to do the same thing without success