Quantcast
Channel: Questions in topic: "ads"
Viewing all articles
Browse latest Browse all 1416

Incorrect portrait Screen.orientation after Unity Ad interstitial playback

$
0
0
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

Viewing all articles
Browse latest Browse all 1416

Trending Articles