Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
6
Question by Mat · Feb 06, 2011 at 08:16 PM · rotationiosorientationscreenorientation

iOS - Smooth auto-rotation of orientation

I would like to have auto-rotation of the device orientation feature on my game (a smooth rotation following the black corner frame, not a one frame flip). You can see this feature in safari and almost any other iOS application out there. But I can't find a way of doing it with Unity other than rotating the camera myself (which is a hacky of doing it though). The Keyboard object seem to rotate correctly but not the Unity viewport.

I've been looking on this site and unity forum but I can't find a direct answer for this question:

"Is there a way to let the device automatically take charge of the smooth rotation when orientation is changed OR do I need to manually rotate the camera ?"

If Unity doesn't provides that feature, is it possible in native Objective-C or Unity prevent this modifications ?

I'm sure a lot of people are looking for this exact same thing...

Thanks !

Mat

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by thomasw · Jul 28, 2011 at 01:14 AM

This is apparently a feature of 3.4, but I haven't figured out how to enable it yet. I've turned in on in the player settings, but it still doesn't appear to work.

http://unity3d.com/unity/whats-new/unity-3.4

Comment
Add comment · Show 7 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image TriplePAF · Jul 29, 2011 at 10:56 PM 2
Share

Works great just enable inside the player under Resolution and Presentation the Auto Rotation option, Use Animated Autorotation and check the orientations you want. You have to create a build to see the results.

avatar image LordThing · Jul 30, 2011 at 11:00 AM 0
Share

I had to activate it in code to get it to work properly (by setting Screen.orientation to ScreenOrientation.autoRotate and then setting Screen.autoRotateToPortrait, Screen.autoRotateToPortraitUpsideDown, Screen.autoRotateToLandscapeLeft and Screen.autoRotateToLandscapeRight to true as needed), but it does work very nicely from then on.

avatar image thomasw · Aug 01, 2011 at 01:45 AM 0
Share

@TriplePAF I'm starting out with the OcclusionCulling sample http://unity3d.com/support/resources/example-projects/iphone-examples.html and setting those values, but the resulting project doesn't autorotate.

avatar image thomasw · Aug 01, 2011 at 02:12 AM 0
Share

O$$anonymous$$. It appears that one of the existing scripts in the project was overriding the effect of the player settings. In the OcclusionCulling's iPhoneAnalogSticks.js script it sets

 iPhoneSettings.screenOrientation = iPhoneScreenOrientation.LandscapeLeft;

This appears to override the player settings and stops the view from autorotating. If you get rid of that line and set the project settings as @TriplePAF says it should work correctly. Thanks.

avatar image Le_nain · Aug 03, 2011 at 09:02 AM 0
Share

DISCLAI$$anonymous$$ER: Don't be too enthusiastic about this new feature, it is not really prefect atm. Please do read http://forum.unity3d.com/threads/98993-Unity-3.4-Portrait-Landscape-Autorotate-on-iOS-looks-bizarre

Show more comments

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Screen.orientation absolutely fails to respond 0 Answers

Low memory crash on IOS when changing orientation 1 Answer

orienting player in one direction 1 Answer

Rotation and screen position problems on iOS 8 0 Answers

GL.LoadProjectionMatrix and Screen.Orientation out of sync 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges