- Home /
How to move player based on device movement direction?
I understand you would use input.accelerate to calculate the rotation of a mobile device in order to rotate or move a gameobject. But, im looking to move a game object, not based on a tilt fashion, but based on the movement of the device. Say at runtime, there would be a Vector3 position of the device, starting at 0,0,0. As I move the device left, for example, the x axis can go down such as -1,0,0, thus moving the player left. How do I find a devices movement direction, so the player has to actually move the device to control a car for example? Thank you.
As of 6/7/13 - "Still accepting any and all answers"
Answer by spinki12 · Dec 11, 2014 at 10:28 PM
Have you tried to use Input.gyro.userAcceleration if so were you happy with the results?
Answer by Coderdood · Jun 08, 2013 at 04:44 AM
For the most info see Unity Input Documentation. Read through all the different things available to you and see what you need. The acceleration and gyroscope would likely be the most useful.
but that doesnt track the actual movement, but only the rotation.
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
How do I invert the Y axis in Penelope tutorial? 3 Answers
Triggering Main Camera Script with GUITexture 1 Answer
Simultaneous button presses 2 Answers