Auto rotate from script

Hi!

I’m currently overriding the Screen.orientation with my own selection based on the current deviceOrientation.

I make a deviceOrientation of lanscapeRight/portrait uses the screen orientation LandscapeRight.
And a deviceOrientation of lanscapeLeft/portraitUpsideDown uses the screen orientation LandscapeLeft.

( and then I rotate my game UI manually)

This all works nicely but I’d like to have the transitions between orientations use the built in auto-rotate.

So is it possible to start the auto rotate manually?

Cheers,
Ryan

To get iOS orientation change animations you should let OS do the job. Simply enable auto orientation in Player Settings and specify which orientations are supported (both landscapes in your case).

I’d like the have the game use the landscape left orientation when the device is actually behing held in portrait updside down. This wont happen if the autorotate is used (it just stays with whatever orientation is currently active). I’d like to trigger the transition myself and maintain the auto rotation.

If it’s not possible in scrip then are there any details exposed in the native code that would let me get this working?

Without this I’m going to have to rotate my whole screen myself for the portrait modes. Just trying to save myself time :smile:

We don’t support such use case out of the box. Though you might play with CoreAnimations in Xcode project.

Thanks for the reply, I think I’m heading in the right direction now! :slight_smile: