I have a car game project on iPhone where you tilt the device left and right to steer,
However everytime you tilt left or right the screen tries to autorotate,
How can you prevent that from happening?
It is very annoying, and I can’t find the answer anywhere on the forum or unity Docs.
Your help is much appreciated.
iPhoneKeyboard.autorotateToPortrait = false;
iPhoneKeyboard.autorotateToPortraitUpsideDown = false;
iPhoneKeyboard.autorotateToLandscapeLeft = false;
iPhoneKeyboard.autorotateToLandscapeRight = false;
Oh, I know this call to the keyboard and used it before, didn’t know it could be used to prevent autorotation.
I will give it a try.
Thank you.
hey, i tried using this. But the game crashes on the device ( iPod touch v 4.1 ), but works on the simulator. can you suggest why is it happening?
Thanks.
this worked for me on iPhone and iPad with no problem.
It might be something else that’s causing the problem, did you try to remove these lines and see if it still crashes ?