- Home /
Smooth Screen Orientation Change on iOS devices
Hi there,
I am currently working on a simple Task that doesn't want to work smooth on iOS devices. I want to be able to change/force the screen Orientation from code, whenever I need to do so, by using this line of code:
Screen.orientation = ScreenOrientation.LandscapeLeft;
Now building the project and running it on android devices runnes smooth. On iOs devices it doesn't, even though its the same code! If I use the autorotation possibilities that Unity provides (witch I can not control in my code), under Player Settings -> Default Orientation -> Autorotate, the screen orientation change is smooth.
Does someone know how I can also get a smooth orientation change on iOS?
Does Apple allow you to force a screen orientation change? I'd assume that was not user friendly enough.
I think so. Anyway my boss wants it, so I have to do it. And it works, but not smooth. You got an idea there?
I am currently attempting the same thing. If you ever did find and answer please let me know. If not I will post if I find a solution to our problem.
I believe it can be done via native code (objective c) using iOS's methods for changing orientation. There should be an animated option. You'll want to apply it to the EagleView that Unity uses to render. I'm staying vague because I only messed with this once a while back, so I'm unfamiliar with the particulars. But I agree, it should be provided by Unity directly.
Hopefully that points you in the right direction.
I'm too finding everywhere for a solution. Normal Apps (from Android Studio) rotate very well in my Galaxy, but Unity Ones does not.
Your answer
![](https://koobas.hobune.stream/wayback/20220613100958im_/https://answers.unity.com/themes/thub/images/avi.jpg)