- Home /
Question by
Fierce Waffle · Nov 22, 2011 at 02:25 AM ·
accelerometer
Make Accelerometer 45 Degrees
This is what I have so far
var accelerator : Vector3 = Input.acceleration;
var t2 : float = accelerator.x;
accelerator.x = -accelerator.y;
//accelerator.y = (accelerator.y + 0.5) * 2;
accelerator.y = t2;
how can I make it so that rather than holding the phone flat to make it drive straight, I hold it at a 45 degree angle to drive straight?
Comment
Answer by givemeharmony · Mar 28, 2012 at 06:28 AM
accelerator.y = accelerator.x - accelerator.z;
Did it for me.
Your answer
![](https://koobas.hobune.stream/wayback/20220613051752im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
accelerometer calibration issue 0 Answers
Calibrating the accelerometer 0 Answers