- Home /
adjust netural position accleromter
I am having problems with iOS accelerometer calibration. i want to adjust the neutral position of the accelerometer when the player hits the adjust button. i use the following code but the code produces unwanted results e.g. when the device is >90 degrees.
function SetNeutral() { tiltzcalibration = Input.acceleration.x; tiltycalibration= Input.acceleration.y; }
function Update() { ..... var acceleration : Vector3f = Input.acceleration;
acceleration.x -= tiltzcalibration;
acceleration.y -= tiltycalibration;
acceleration.Normalize();
....
}
Your answer
Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Accelerometer input working in Unity Remote, not working in build. 1 Answer
Player Movement in Apple TV 0 Answers
MMD How to export model and animations to Unity as 3rd person controller? 2 Answers
ios bluetooth gamepad input working only on input text fields 0 Answers