Search Unity

Screen goes crazy and keep flickering after opening EVERYPLAY service and rotates device

Discussion in 'Unity Everyplay' started by gshape, Apr 20, 2015.

  1. gshape

    gshape

    Joined:
    Aug 8, 2012
    Posts:
    96
    We integrated EVERYPLAY in one of our coming games, it is a landscape game (and set to not allowed to rotate the screen already). However, we found that if a play open the everyplay screen in the game (e.g. after sharing a video) and rotate the device form landscape to portrait, the screen goes crazy and keep flickering.
    It never restore until quit game/app completely. For instance, the attached screen for your reference.



    P.S. Testing on iPhone 5, iPhone 6 Plus, iPad Mini 2 with latest iOS with latest version of Everyplay plugin on asset store.
    By the way, I actually raise an request #22850.

    Could anyone please kindly advice how to solve/prevent this problem?
    Thank you.
     
  2. surathunity3d

    surathunity3d

    Unity Technologies

    Joined:
    Sep 30, 2014
    Posts:
    128
    Hi @gshape

    I replied to your ticket.
    Could you please send us a test case (using the ticket) where this issue can be easily reproduced?

    Cheers,
    Surath

    PS: I am not sure whether this is an issue which might affect others or not - If it does, I will post here further after it gets resolved.
     
  3. gshape

    gshape

    Joined:
    Aug 8, 2012
    Posts:
    96
    Hi @surathunity3d,

    I prepared a project that can re-produce the problem for you. You may download from the link in the reply of ticket system.

    Steps to reproduce:
    1. Open the project
    2. Change the information needed so you can take an iOS build on your machine
    3. Take an iOS build
    4. Open Xcode project and build and run on devices (we tested it on iPhone 5 and 6 plus with latest iOS)
    5. Hold the device horizontally
    6. After you see the Unity logo, wait for 2 seconds (while it is recording the screen)
    7. Then you will see a "Play" button, click it and share the video
    8. When you see a "successful" message from EVERYPLAY, click the "community" button
    9. then, you will see my game page on Everyplay horizontally
    10. Next, rotate your device 90 degrees and you will see the screen goes crazy like my screen capture before.

    Hope this helps.

    Thanks.

    Regards,
    William
     
  4. gshape

    gshape

    Joined:
    Aug 8, 2012
    Posts:
    96
    Hi @surathunity3d,

    I have re-sent a correct URL of the re-prod case via ticket system. Hope this helps.
    Thanks.

    Regards,
    William
     
  5. CPR21

    CPR21

    Joined:
    Nov 20, 2013
    Posts:
    2
    same problem here , play the last recording, and try to rotate screen from portrait (my game) to landscape , it mess up my screen.

    PS iOS 8.03
     
    Last edited: May 12, 2015
  6. pmjo

    pmjo

    Unity Technologies

    Joined:
    Sep 17, 2013
    Posts:
    165
    Issue seems to be iOS 8 only but happens on both, iPhone and iPad.

    I found a temporary workaround to fix it:

    1. Open the file UnityViewControllerBase.mm in your xCode project
    2. Change the line 192 from
    if(UNITY_IOS8_ORNEWER_SDK && _ios80orNewer && viewWillTransitionToSize)
    to
    if(NO && UNITY_IOS8_ORNEWER_SDK && _ios80orNewer && viewWillTransitionToSize)

    That will disable the iOS8 specific code path that seems to fail when orientation is locked to single orientation.
     
  7. gshape

    gshape

    Joined:
    Aug 8, 2012
    Posts:
    96
    Hi @pmjo ! Thanks for your suggestion.
    The workaround fixed this problem! :)
     
  8. gshape

    gshape

    Joined:
    Aug 8, 2012
    Posts:
    96
    Hi @pmjo , I found that on iOS8, opening Leaderboard and Achievement board of Game Center got same problem even I implemented above workaround.
     
  9. pmjo

    pmjo

    Unity Technologies

    Joined:
    Sep 17, 2013
    Posts:
    165
    Apparently it is a bug in the Unity iOS trampoline. Unfortunately I don't yet know when a fix is available but hopefully soon. I'll ping here when it's out.
     
  10. Maulwurfmann

    Maulwurfmann

    Joined:
    Mar 11, 2014
    Posts:
    366
    Any news regarding this?
     
  11. surathunity3d

    surathunity3d

    Unity Technologies

    Joined:
    Sep 30, 2014
    Posts:
    128
    Hi everyone,

    Everyplay 1970-1340 package has a bunch of fixes for Metal pipeline, which might fix this.
    However, if it is not, then we need to wait for the fix to come from the core Unity team as this is at the Engine level in Unity's iOS trampoline, like pmjo mentioned in his last post.

    Thanks for your patience!

    Cheers
    Surath
     
  12. John-B

    John-B

    Joined:
    Nov 14, 2009
    Posts:
    1,110
    I'm having the same problem, but I'm not using Everyplay or anything else. Just trying to force an orientation change. The change to UnityViewControllerBase.mm does not fix it.

    I'm going from a main menu scene in landscape to a scene that needs to be in portrait. Here's my code"

    Code (JavaScript):
    1.     Screen.autorotateToPortrait = true;
    2.     Screen.autorotateToPortraitUpsideDown = true;
    3.     Screen.autorotateToLandscapeLeft = false;
    4.     Screen.autorotateToLandscapeRight = false;
    5.     Screen.orientation = ScreenOrientation.Portrait;
    6.     yield WaitForSeconds(1.0);
    7.     Screen.orientation= ScreenOrientation.AutoRotation;
    8.  
    9.     async = Application.LoadLevelAsync("Level-Pulley");
    10.     yield async;
    And here's the exact same code returning to the main menu:

    Code (JavaScript):
    1.     Screen.autorotateToLandscapeLeft = true;
    2.     Screen.autorotateToLandscapeRight = true;
    3.     Screen.autorotateToPortrait = false;
    4.     Screen.autorotateToPortraitUpsideDown = false;
    5.     Screen.orientation = ScreenOrientation.LandscapeRight;
    6.     yield WaitForSeconds(1.0);
    7.     Screen.orientation= ScreenOrientation.AutoRotation;
    8.  
    9.     async = Application.LoadLevelAsync("Main Menu");
    10.     yield async;
    The first time through, going from the landscape main menu to the portrait level, it works correctly. The screen rotates smoothly just as the new level loads. But the same code that returns to the main menu causes the screen to flicker rapidly between two orientations. The flicker continues until the main menu scene is loaded. After that, going to or from the main menu causes the flicker.

    Any suggestions? Am I doing the screen rotation incorrectly?

    Just to be clear, this is on iOS (iPad only) using Il2CPP.
     
    Last edited: Jul 30, 2015
  13. John-B

    John-B

    Joined:
    Nov 14, 2009
    Posts:
    1,110
    I've given up on trying to change the screen orientation. I spent a LOT of time on this, but no matter what I've tried, at best I can get it to work once without the flicker. Which means I can change the orientation form landscape to portrait, but not back again.

    I'm not sure where the problem is, but I know this used to work. I pulled out an old project from before there was an auto-rotate setting in the Inspector. That app checked device orientation and rotated the screen as necessary in LateUpdate, and it worked just fine.
     
unityunity