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
0
Question by jongallant · Nov 25, 2014 at 01:59 PM · androidorientationautorotate

How to make Unity Player respect Android system settings

I am trying to get my Unity player to auto rotate based on the device. You can easily do this by setting the Screen Orientation to "Auto Rotate". This works fine, however, when the system settings of an android device is set to "Disable auto rotate", Unity continues to rotate the application.

In iOS, setting your device to not auto-rotate disables the unity rotation, as expected.

This is a major bug in the Unity player. I have been trying to find a work around and have been unable to do so.

How do I create an application, for android, that will auto rotate only if the device system settings allows for it?

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

2 Replies

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

Answer by jongallant · Nov 26, 2014 at 04:10 PM

This is a major bug in Unity. For those who are stumbling here trying to find a solution, a very awesome gentlemen posted a fix over here at github

https://github.com/hvs-clark/unity-android-rotation-lock

Hopefully Unity fixes this crazy bug soon, so we don't have to use workarounds like this in the future. From what I read, it is by design, which in my opinion is horrible design. https://github.com/hvs-clark/unity-android-rotation-lock

Comment
Add comment · Show 3 · 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 Yury-Habets ♦♦ · Nov 26, 2014 at 07:03 PM 0
Share

This plugin sets Portrait, which is incorrect for tablets, and is incorrect for Landscape-designed games. Landscape can also disappoint as on some devices it is messed up. The things are not black-and-white; doing a quick fix and supporting an entire range of devices are different things. The best thing you can really do is submit a bug, not make public judgements about the design.

avatar image jongallant · Nov 26, 2014 at 07:10 PM 0
Share

This is the workaround. I submitted a bug report already, which will most likely be ignored, as this is by design. The example provided is just an example, a proof of concept. You can make it work the way you want. Bottom line is, this is a valid work around, so use it if you encounter this bug.

avatar image Yury-Habets ♦♦ · Nov 26, 2014 at 07:18 PM 0
Share

This workaround is a close equivalent to just setting "Portrait" in the player settings, which I recommend doing if you care about the orientation. And thank you for submitting the bug!

avatar image
0

Answer by Yury-Habets · Nov 26, 2014 at 08:13 AM

Please submit a bug report if you consider this is unintended behavior.

Comment
Add comment · Show 2 · 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 jongallant · Nov 26, 2014 at 11:51 AM 0
Share

Yes, I have already submitted a bug. I am currently looking for a workaround for this problem. Any suggestions as to what I could do would be greatly appreciated.

avatar image Yury-Habets ♦♦ · Nov 26, 2014 at 12:32 PM 0
Share

Yes - write a plugin or use AndroidJava* API to make necessary system calls, adjust Screen.orientation accordingly. Or set your game to a fixed orientation in the Player settings.

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

27 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

OS Status Bar and Rotation on Android 0 Answers

Application always launches with same orientation on Android, regardless of OS orientation. 1 Answer

Android screen rotation very slow and my audio keeps going but the graphics stop 0 Answers

Problem using WebCamTexture.videoRotationAngle on Android 0 Answers

Unity Pro Android orientation on splash image 1 Answer


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