- Home /
Question by
TigrisGames · Dec 27, 2020 at 03:58 PM ·
inputmobileaccelerometergyroscope
how to move an object in 4 directions by tilting device when not parallel to the ground
I want to move an object in x and y axis by tilting the device in up and right read directions [ not by rotating it by accelerating towards a point ]
I used Input.acceleration but it only works when the device is parallel with the ground
the image shows the 2 directions i want to rotate on when facing my forward face direction
tilt2.png
(73.3 kB)
Comment
Those directions are both on the Input.acceleration.x axis. I don't know of any way to distinguish the directions using just the accelerometer itself. @TigrisGames
Input.acceleration.x and the z the problem is that the acceleration.z is affected by gravity so its value depends on rotating the device not by accelerating it