I’m trying to support both right and left landscape orientations. The problem is that when testing my game on a iPad, leaving the iPad laying flat on the table makes it flip constantly between both orientations (this does not happen when testing with an iPhone).
This makes the game unplayable unless you hold the iPad somehow tilted. Here’s the code I’m currently, what can I change to prevent this problem?
if ((Input.deviceOrientation == DeviceOrientation.LandscapeLeft) (Screen.orientation != ScreenOrientation.LandscapeLeft))
{
Screen.orientation = ScreenOrientation.LandscapeLeft;
}
if ((Input.deviceOrientation == DeviceOrientation.LandscapeRight) (Screen.orientation != ScreenOrientation.LandscapeRight))
{
Screen.orientation = ScreenOrientation.LandscapeRight;
}