Screen Autorotation

Can anyone supply working javascript snippets that will allow complete screen rotation for both Android and Iphone mobile devices?

New in i think unity 3.3 you can set the default rotation to autorotation. Take a look at player settings from the build settings window

Its under resolution and presentation

There is no Autorotation option under resolution and presentation. Any other ideas?

Heavy, I just opened up Unity, and indeed under Resolution and Presentation with the iOS and Android there is the option for auto rotation. It is the last option under the Default Orientation drop down box.

I checked again and when I click on “Default Orientation” for Android in Player Settings my only options are:

Portrait
Portrait Upside Down (IOs and Gingerbread Only)
Portrait Right (IOs and Gingerbread Only)
Landscape Left

Thoughts?

Would I use PlayerSettings.useOSAutorotation?

What would this completed javascript look like?

Many thanks.

I used the script at the bottom of this page to autorotate - http://drupal.technicat.com/games/unity/iphone/ipad.html

But I don’t use it anymore, now I use the Unity autorotate feature others here have mentioned, for both iOS and Android. If you have Unity 3.4, you should see it. (the page I linked to has a screenshot)

Thanks fellas.

I now see the problem… I was using 3.3 which didn’t have this feature