- Home /
iPhone Gyroscope problem
My game is about a ball, which player should roll to the center of the round maze. But something odd with gyroscope. When i tilt iPhone, for example, straight forward, Gyroscope gives me wrong direction. This is the line of code:
GetComponent ().AddForce (Input.gyro.attitude.x * force, 0, Input.gyro.attitude.y * force, ForceMode.VelocityChange);
But when it should be (90,0,0) , it is something like (90,0,30);
I mean, the ball should be, when tilt straight forward for example, right at the top of the round maze, but it is a little to the right. Same for every side.
What is the cause and how to solve it?
I thought maybe to change World Axis, but i don't know how and what changes exactly. Or maybe use camera to lock it to gyroscope axis at the start of the scene somehow? Or should use wrapper class between input reading and controls? but i am not sure how to correct gyroscope readings in that situation.
Your answer
Follow this Question
Related Questions
tilt control acceleration 1 Answer
iOS Tilt input and constant force 0 Answers
Gyroscope based First person controller 0 Answers
Using gyroscope to get forward backward acceleration 1 Answer
Obtaining and Filtering Gyroscope/Accelerometer Data 1 Answer