• 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
2
Question by Tony Povey · Jun 02, 2015 at 10:40 AM · screenadsorientationportraitincorrect

Incorrect portrait Screen.orientation after Unity Ad interstitial playback

My iOS game supports autorotation in portrait and portrait upside down formats only. If I output the value of Screen.orientation with the phone upright and upside down I get Portrait and PortraitUpsideDown values as you would expect.

My problem occurs after playing a Unity Ad interstitial video, this has been tested on an iPhone 5S. While the video is playing I rotate the iPhone to landscape orientation and then skip the video, then close the static ad end screen to return to the game. On returning to the game it is still in Portrait orientation as you would expect. The issue is that the Screen.orientation value is now inverted, when the phone is upright the value is PortraitUpsideDown and when upside down it is Portrait. This remains the case when you rotate the device back and forth, it continues to be the opposite of what you'd expect.

For most people I can see that this would not cause a problem, however, I make use of Input.acceleration in conjunction with compensateSensors. I find that the axis are reversed with +X to the left rather than right. So the compensation is relying on the now incorrect Screen.orientation. I cannot turn off compensateSensors and correct it myself as I would also be reliant on this incorrect Screen.orientation value. Note that Input.deviceOrientation is correct in all cases, however, this is not guaranteed to match the actual screen orientation so is of limited use.

Has anyone experienced these same issues or found a work around? I'm guessing this is a bug.

Unity version 5.0.2f1, Unity Ads version 1.1.4

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

0 Replies

· Add your reply
  • Sort: 

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

Screen orientation change in scenes (unwanted effect) 1 Answer

Difference between Screen.orientation - Input.deviceOrientation 2 Answers

Orientation Problem 1 Answer

How to test Screen Orientation? 3 Answers

Hey I would like to learn via script how to change automatically the screen orientation 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges