- Home /
Mobile Tilt Problem
Hello, i'm creating FPS game for mobile but i have little problem in my code that if i want to look right or left i must tilt the phone like the Car Steering wheel i dont need it that way i want to rotate the phone in x axis
sorry my english is bad this photo may explain what i want
rotationX += Input.acceleration.x * sensitivityX;
rotationX = Mathf.Clamp (rotationX, minimumX, maximumX);
// transform.localEulerAngles = new Vector3(0,rotationX, 0);
transform.rotation = Quaternion.Euler(0, rotationX, 0.0f);
i hope someone can help me or guide me to the right way
I dont think so you need to clamp it just add the transform to the current transform if you are getting the correct input from the user
I remember what I did was change the accleration of the mobile to angle and took the input .
@alok.kr.029
can you tell me more info please or tell me what i should google
because its first time dealing with mobile stuff and i must fix this issue ,
Thanks
To look around wont it be better if you use gyro scope but if you still want to use accleratometer check the link given below it will help you
actually its been a long time , if you still have problem let me know.
Your answer
Follow this Question
Related Questions
Rotate Camera using Accelerometer 0 Answers
Unity Noob: Unknown identifier error after building project on Android platform. 0 Answers
Benchmark FPS Counter 2 Answers
Help with android shake intensity. 0 Answers
Android update math at higher hz? 2 Answers