Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Bug Game may start with incorrect Orientation

Discussion in 'iOS and tvOS' started by kyubuns, Mar 10, 2023.

  1. kyubuns

    kyubuns

    Joined:
    Aug 6, 2013
    Posts:
    142
    My game limits "Allowed Orientations for Auto Rotation" to "Landscape Right" and "Landscape Left" in "Player Settings".
    However, it sometimes starts in "Portrait" or "Portrait Upside Down" on the iPhone.

    This started happening after I updated from Unity2020 to 2021.

    Current environment is Unity 2021.3.16f1, running iOS 16.2.
    We have not been able to investigate this issue in detail due to its infrequency.
    Does anyone have any information on this?

    Is the iOS screen rotation buggy in relation to this issue?
    Does anyone know of any workarounds?
    https://issuetracker.unity3d.com/is...entation-to-autorotation-at-runtime-on-ios-16
     
    Last edited: Mar 10, 2023
    ing_unity likes this.
  2. kyubuns

    kyubuns

    Joined:
    Aug 6, 2013
    Posts:
    142
    Player Settings are as follows
     

    Attached Files:

  3. IgorBoyko

    IgorBoyko

    Joined:
    Sep 28, 2020
    Posts:
    90
    Same here on 2021.3.18f1, without autorotation enabled. The game would just randomly rotate to landscape on its own, started seeing this since iOS 16 update in particular.
     
  4. nhannguyen2gl

    nhannguyen2gl

    Joined:
    Mar 8, 2018
    Posts:
    3
    same here 2021.3.18,
    My app is starting and landscape but in one scene it needs to switch to Portrait
    On Android and ios 15 it's fine but it's keeping landscape and cannot switch to portrait on ios 16
     
  5. OneKnife

    OneKnife

    Joined:
    Aug 7, 2017
    Posts:
    4
    Same Problem in Unity 2019.4.18f1, still looking for a fix.
     
  6. chrismarch

    chrismarch

    Joined:
    Jul 24, 2013
    Posts:
    473
    We may be seeing a similar bug, where a portrait orientation is displayed when we switch from an iOS OS screen (lock screen, etc.) to our Unity player application, which has only landscape modes checked for the Allowed Orientations for Auto Rotation.
    We noticed that the bug may not have reproducible on an iPhone 13 with iOS 16.1.2, but it did occur when upgrading that device to iOS 16.4.1, which was done just to attempt the reproduction of the bug.
     
  7. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,631
    kyubuns likes this.
  8. dorisdabao

    dorisdabao

    Joined:
    Jan 5, 2022
    Posts:
    49
    Is there a temporary solution please, I see that someone in IOS developer calls when rotating
    if #available(iOS 16.0, *) {
    self. setNeedsUpdateOfSupportedInterfaceOrientations()
    }
    solve this problem
     
    nhannguyen2gl likes this.
  9. dorisdabao

    dorisdabao

    Joined:
    Jan 5, 2022
    Posts:
    49
    As a temporary solution, is it feasible to call SetNeedsUpdateOfSupportedInterfaceOrientations once when the game starts in xcode?
     
  10. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,631
    > is it feasible to call SetNeedsUpdateOfSupportedInterfaceOrientations once when the game starts in xcode?

    yeah, in UI/UnityViewControllerBase+iOS.mm we have two places (why two? oh well, that happened) where we update controller orientations: in init and updateSupportedOrientations
    you can add to both i guess (alas, i was not able to repro still, so blindly "fixing" is a bit meh)
     
  11. dorisdabao

    dorisdabao

    Joined:
    Jan 5, 2022
    Posts:
    49
    This bug cannot be reproduced stably. First of all, you need to make your iphone as parallel to the ground as possible, cut the game in vertical screen or lock the screen and exit and then quickly open the game. This may also have something to do with the sensor
     
  12. dorisdabao

    dorisdabao

    Joined:
    Jan 5, 2022
    Posts:
    49
    Code (CSharp):
    1. - (id)init
    2. {
    3.     if ((self = [super init]))
    4.     {
    5.         if (@available(iOS 16.0, *)) {
    6.             [self setNeedsUpdateOfSupportedInterfaceOrientations];
    7.         }
    8.         NSAssert(UnityShouldAutorotate(), @"UnityDefaultViewController should be used only if unity is set to autorotate");
    9.         _supportedOrientations = EnabledAutorotationInterfaceOrientations();
    10.        
    11.        
    12.     }
    13.     return self;
    14. }
    15.  
    16. - (void)updateSupportedOrientations
    17. {
    18.     if (@available(iOS 16.0, *)) {
    19.         [self setNeedsUpdateOfSupportedInterfaceOrientations];
    20.     }
    21.     _supportedOrientations = EnabledAutorotationInterfaceOrientations();
    22. }
    I try this method but it doesn't work, if anyone is proficient in IOS development, please guide me
     
  13. dorisdabao

    dorisdabao

    Joined:
    Jan 5, 2022
    Posts:
    49
    I read in some posts that it seems that the
    Code (CSharp):
    1. [[UIDevice currentDevice] setValue:orientationTarget forKey:@"orientation"];
    Call requestGeometryUpdateWithPreferences instead

    Code (CSharp):
    1. NSArray *array = [[[UIApplication sharedApplication] connectedScenes] allObjects];
    2.          UIWindowScene *scene = [array firstObject];
    3.          // screen orientation
    4.          UIInterfaceOrientationMask orientation = isLaunchScreen ? UIInterfaceOrientationMaskLandscapeRight : UIInterfaceOrientationMaskPortrait;
    5.          UIWindowSceneGeometryPreferencesIOS *geometryPreferencesIOS = [[UIWindowSceneGeometryPreferencesIOS alloc] initWithInterfaceOrientations:orientation];
    6.          // start switching
    7.          [scene requestGeometryUpdateWithPreferences:geometryPreferencesIOS errorHandler:^(NSError * _Nonnull error) {
    8.              NSLog(@"Force %@Error: %@", isLaunchScreen ? @"Horizontal screen" : @"Vertical screen", error);
    9.          }];
    May I ask where is the place where unity modifies the orientation?
     
  14. Andrii_Hi

    Andrii_Hi

    Joined:
    Oct 20, 2021
    Posts:
    1
    We've been able to reproduce the issue with orientation on iPhone XR ( iOS 16.3.1). We use "Auto Rotation" with "Ladscape Left" and "Landscape Right" checked. But still the game will be displayed in a portrait mode if these steps are followed:

    1. Open the game
    2. Don't touch the screen for a few minutes while the screen goes to the screen lock mode
    3. Wait for 5 minutes
    4. Unlock the screen
    5. Turn the phone to the portrait mode

    Any workarounds?
     
    Scorpion_1980 likes this.
  15. dorisdabao

    dorisdabao

    Joined:
    Jan 5, 2022
    Posts:
    49
    Yes, on 16.3 and 16.4, this bug often occurs when you unlock the screen after a period of time. On 16.2, you don’t even need to lock the screen. You just need to enter the vertical screen and kill the process. Open the game again and it will appear
     
  16. dorisdabao

    dorisdabao

    Joined:
    Jan 5, 2022
    Posts:
    49
    For this reason, I upgraded unity from 2020.3.2 to 2020.3.46 and still have the same problem
    This BUG may need to be modified in the OC code used for rotation in unity, but I haven't found the specific location, if anyone knows, please let me know
     
  17. chrismarch

    chrismarch

    Joined:
    Jul 24, 2013
    Posts:
    473
    I don't see updateSupportedOrientations in the UnityViewControllerBase.mm output from Unity 2020.3.45f1:


    Code (CSharp):
    1. #import "UnityViewControllerBase.h"
    2. #import "UnityAppController.h"
    3. #import "UnityAppController+ViewHandling.h"
    4.  
    5. #include "OrientationSupport.h"
    6.  
    7.  
    8. @implementation UnityViewControllerBase
    9.  
    10. @synthesize notificationDelegate = _notificationDelegate;
    11.  
    12. - (id)init
    13. {
    14.     if ((self = [super init]))
    15.         self.modalPresentationStyle = UIModalPresentationFullScreen;
    16.     return self;
    17. }
    18.  
    19. - (void)viewWillLayoutSubviews
    20. {
    21.     [super viewWillLayoutSubviews];
    22.     [_notificationDelegate onViewWillLayoutSubviews];
    23. }
    24.  
    25. - (void)viewDidLayoutSubviews
    26. {
    27.     [super viewDidLayoutSubviews];
    28.     [_notificationDelegate onViewDidLayoutSubviews];
    29. }
    30.  
    31. - (void)viewDidDisappear:(BOOL)animated
    32. {
    33.     [super viewDidDisappear: animated];
    34.     [_notificationDelegate onViewDidDisappear: animated];
    35. }
    36.  
    37. - (void)viewWillDisappear:(BOOL)animated
    38. {
    39.     [super viewWillDisappear: animated];
    40.     [_notificationDelegate onViewWillDisappear: animated];
    41. }
    42.  
    43. - (void)viewDidAppear:(BOOL)animated
    44. {
    45.     [super viewDidAppear: animated];
    46.     [_notificationDelegate onViewDidAppear: animated];
    47. }
    48.  
    49. - (void)viewWillAppear:(BOOL)animated
    50. {
    51.     [super viewWillAppear: animated];
    52.     [_notificationDelegate onViewWillAppear: animated];
    53. }
    54.  
    55. @end
    56.  
    57. UnityViewControllerBase* AllocUnityDefaultViewController()
    58. {
    59.     return [UnityDefaultViewController alloc];
    60. }
    61.  
    62. #if UNITY_SUPPORT_ROTATION
    63. UnityViewControllerBase* AllocUnitySingleOrientationViewController(UIInterfaceOrientation orient)
    64. {
    65.     switch (orient)
    66.     {
    67.         case UIInterfaceOrientationPortrait:            return [UnityPortraitOnlyViewController alloc];
    68.         case UIInterfaceOrientationPortraitUpsideDown:  return [UnityPortraitUpsideDownOnlyViewController alloc];
    69.         case UIInterfaceOrientationLandscapeLeft:       return [UnityLandscapeLeftOnlyViewController alloc];
    70.         case UIInterfaceOrientationLandscapeRight:      return [UnityLandscapeRightOnlyViewController alloc];
    71.  
    72.         default:                                        assert(false && "bad UIInterfaceOrientation provided");
    73.     }
    74.     return nil;
    75. }
    76.  
    77. #endif
    78.  
    79. UnityViewControllerBase* AllocUnityViewController()
    80. {
    81. #if UNITY_SUPPORT_ROTATION
    82.     if (UnityShouldAutorotate())
    83.         return AllocUnityDefaultViewController();
    84.  
    85.     UIInterfaceOrientation orient = ConvertToIosScreenOrientation((ScreenOrientation)UnityRequestedScreenOrientation());
    86.     return AllocUnitySingleOrientationViewController(orient);
    87. #else
    88.     return AllocUnityDefaultViewController();
    89. #endif
    90. }
    91.  
     
  18. dorisdabao

    dorisdabao

    Joined:
    Jan 5, 2022
    Posts:
    49

    Because he is in UI/UnityViewControllerBase+iOS instead of UnityViewControllerBase, I have tried this and it has not worked
     
    chrismarch likes this.
  19. chrismarch

    chrismarch

    Joined:
    Jul 24, 2013
    Posts:
    473
    What is your highest reproduction percentage, roughly? And, which hardware, OS and steps?
    I haven't had any luck with an iPhone 12 pro max and iOS 16.4.1 with our app, which my team does see the bug with on iPhone 12-14 and iOS 16.3-4.
     
  20. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,631
    For whoever sees incorrect orientation, can you please try the following:
    in Classes/UI/UnityViewControllerBase+iOS.mm
    find
    Code (csharp):
    1. - (void)viewDidAppear:(BOOL)animated
    and add above:


    Code (csharp):
    1. - (void)viewWillAppear:(BOOL)animated
    2. {
    3.     _currentOrientation = UIViewControllerOrientation(self);
    4.     [GetAppController() updateAppOrientation: ConvertToIosScreenOrientation(_currentOrientation)];
    5.     [super viewWillAppear: animated];
    6. }
    7.  
    so it looks like this

    Code (csharp):
    1.  
    2. - (void)viewWillAppear:(BOOL)animated
    3. {
    4.     _currentOrientation = UIViewControllerOrientation(self);
    5.     [GetAppController() updateAppOrientation: ConvertToIosScreenOrientation(_currentOrientation)];
    6.     [super viewWillAppear: animated];
    7. }
    8.  
    9. - (void)viewDidAppear:(BOOL)animated
    10. {
    11.     _currentOrientation = UIViewControllerOrientation(self);
    12.     [GetAppController() updateAppOrientation: ConvertToIosScreenOrientation(_currentOrientation)];
    13.     [super viewDidAppear: animated];
    14. }
    15.  
    16. - (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator
    17. {
    18.  
     
    OC-Ishikawa likes this.
  21. dorisdabao

    dorisdabao

    Joined:
    Jan 5, 2022
    Posts:
    49
    I tried this method just now, but it didn't work, and there is still a chance that it will open from the wrong direction when opening
     
  22. dorisdabao

    dorisdabao

    Joined:
    Jan 5, 2022
    Posts:
    49
    All our IOS devices here will, iphone11 16.3 (20D47), iPad (8th generation) 16.2 (20C65), iphone14 16.3.1 (20D67), iphone14 pro 16.2 (20C65), the easiest to reproduce is iphone14 pro 16.2 (20C65), just need to enter the game first ( Game Orientation is set to LandscapeLeft), and then the game switches to Portrait, kills the game process, clicks the game again to enter, there is a high probability of appearing, if you kill the process, wait a while, enter the game, this BUG will not appear, just like the IOS horizontal and vertical tips of the game has a problem
     
    nhannguyen2gl likes this.
  23. dorisdabao

    dorisdabao

    Joined:
    Jan 5, 2022
    Posts:
    49
    iphone11 16.3 (20D47), iPad (8th generation) 16.2 (20C65), iphone14 16.3.1 (20D67), iphone14 pro 16.2 (20C65), the easiest to reproduce is iphone14 pro 16.2 (20C65),

    iphone14 just need to enter the game first ( Game Orientation is set to LandscapeLeft), and then the game switches to Portrait, kills the game process, clicks the game again to enter, there is a high probability of appearing, if you kill the process, wait a while, enter the game, this BUG will not appear, just like the IOS horizontal and vertical tips of the game has a problem
     
    nhannguyen2gl likes this.
  24. dorisdabao

    dorisdabao

    Joined:
    Jan 5, 2022
    Posts:
    49
    Is there any progress on this issue now?
     
  25. nhannguyen2gl

    nhannguyen2gl

    Joined:
    Mar 8, 2018
    Posts:
    3
    upload_2023-5-17_17-10-22.png
    I see the status is In progress for 2023. I guess we need to wait a bit more for 2021 and 2022
     
    Pavel_989 likes this.
  26. RaventurnPatrick

    RaventurnPatrick

    Joined:
    Aug 9, 2011
    Posts:
    281
    Can you post a link to the issue? Also under consideration does not automatically mean it will be fixed for 2021/2022
     
  27. Vongola_Bili

    Vongola_Bili

    Joined:
    Aug 15, 2021
    Posts:
    5
    I got the same problem and resolved it. Everyone can try it.
    I found that in iOS 16, it is possible to receive incorrect orientation callbacks. I don't know how to avoid this error, but I forcefully refresh the screen to the correct orientation.
    In UnityViewControllerBase+iOS.mm


    Code (CSharp):
    1. - (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator
    2. {
    3.     // ...
    4.     [super viewWillTransitionToSize: size withTransitionCoordinator: coordinator];
    5.  
    6.     // Here is the fixing code
    7.     // when get unsupported orientation in ios16
    8.     if (([self supportedInterfaceOrientations] & targetMask) == 0)
    9.     {
    10.         _currentOrientation = curOrient; // keep the last orientation
    11.         UIInterfaceOrientation targetOrientation = ConvertToIosScreenOrientation(_currentOrientation);
    12.         targetMask = 1 << targetOrientation;
    13.      
    14.         if (([self supportedInterfaceOrientations] & targetMask) == 0)
    15.         {   // sometimes the first orientation is 0 (orientationUnknown)
    16.             // choose the preferred orientation or supported orientation
    17.             targetMask = [self supportedInterfaceOrientations];
    18.             targetOrientation = [self preferredInterfaceOrientationForPresentation];
    19.         }
    20.      
    21.         // fouce screen orientation
    22.         if (@available(iOS 16.0, *))
    23.         {
    24.             [self.navigationController setNeedsUpdateOfSupportedInterfaceOrientations];
    25.             [self.tabBarController setNeedsUpdateOfSupportedInterfaceOrientations];
    26.          
    27.             UIWindowSceneGeometryPreferencesIOS *geometryPreferences = [[UIWindowSceneGeometryPreferencesIOS alloc] init];
    28.             geometryPreferences.interfaceOrientations = targetMask;
    29.          
    30.             UIWindowScene *ws = self.view.window.windowScene;
    31.             [ws requestGeometryUpdateWithPreferences:geometryPreferences errorHandler:^(NSError * _Nonnull error) {
    32.                 if(error != nil)
    33.                 {
    34.                     NSLog(@"fouce change orientation when rotate to unsupport. code: %d %@", (int)error.code, error.description);
    35.                 }
    36.             }];
    37.         }
    38.         else
    39.         {   // If the iOS version is not 16, this issue should not occur. Just to be safe, let's make it compatible.
    40.             [[UIDevice currentDevice] setValue:[NSNumber numberWithInteger:targetOrientation] forKey:@"orientation"];
    41.         }
    42.     }
    43. }
     
    katsumasaUnity3d likes this.
  28. atasayin1

    atasayin1

    Joined:
    Nov 18, 2020
    Posts:
    8
    Same problem here with iPadOS 16.5, i'm waiting for more elegant solution, since there could be side effects of overwriting an build code.
     
  29. JoJoJoX

    JoJoJoX

    Joined:
    Jun 23, 2022
    Posts:
    54
    Last edited: Jul 27, 2023
    RaventurnPatrick likes this.
  30. RaventurnPatrick

    RaventurnPatrick

    Joined:
    Aug 9, 2011
    Posts:
    281
  31. JoJoJoX

    JoJoJoX

    Joined:
    Jun 23, 2022
    Posts:
    54
    You are right. But I dont want to upgrade the Unity version right now. I just copy the Objective-C/C++ code that they modified between v2021.3.27f1 and v2021.3.28f1. So I dont really reproduce the bug in v2021.3.28f1. Maybe codes somewhere else are modified too.

    It would be nice if someone test it in v2021.3.28f1.
     
  32. jperry_oddgames

    jperry_oddgames

    Joined:
    Sep 18, 2017
    Posts:
    62
    We're seeing this issue occur in 2022.3.4f1 despite the issue tracker suggesting it should be fixed. Device is an iPad Air (3rd generation), os version 15.6.1

    I'm not sure the issue described in the tracker link is exactly what we're seeing. It appears the fix only concerns changes to orientation at runtime, whereas our issue occurs on launch and is not triggered by a call to
    Screen.orientation
    or similar api calls.

    For clarification: We see our game incorrectly launch in Portrait orientation when the device is held in portrait despite only allowing landscape (left & right). This actually seems to match exactly what @kyubuns mentioned at the start of this thread. After launching, rotating the device to landscape will rotate the game orientation as expected and it is no longer able to enter portrait orientation.

    @Alexey are you able to provide more insights; is this a separate bug?
     
  33. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,631
    > We're seeing this issue occur in 2022.3.4f1 despite the issue tracker suggesting it should be fixed. Device is an iPad Air (3rd generation), os version 15.6.1

    huh, that's weird - it was fixed in *2022.3.5f1* - i wonder how it got misreported in web interface
     
    jperry_oddgames likes this.
  34. jperry_oddgames

    jperry_oddgames

    Joined:
    Sep 18, 2017
    Posts:
    62
    @Alexey beautiful, that's the info I needed. I'll upgrade our Unity version accordingly and report back if it's still a problem after our next release. Thank you
     
  35. dorisdabao

    dorisdabao

    Joined:
    Jan 5, 2022
    Posts:
    49
    Hello, I tried it according to this method, and the screen turning error has indeed been reduced, but when opening the game → killing process extremely quickly and many times→ opening the game→killing process → opening the game, there is a probability of flashback, and there is a small probability that there is still a problem of vertical screen entering the open game
     
  36. zhangfree111

    zhangfree111

    Joined:
    Mar 5, 2020
    Posts:
    2
    We meet this BUG in 2018.4.36f1,so how to fix this BUG in 2018 vesion.
     
  37. zhangfree111

    zhangfree111

    Joined:
    Mar 5, 2020
    Posts:
    2
    It's impossible for us to upgrade engine version to 2021
     
  38. dorisdabao

    dorisdabao

    Joined:
    Jan 5, 2022
    Posts:
    49
    Upgrading is also useless, I just experimented with 2022.3.4f1 and the problem remains
     
  39. dorisdabao

    dorisdabao

    Joined:
    Jan 5, 2022
    Posts:
    49
    I upgraded the project to 2022.3.4f1, but I quickly opened the game→killing process→ opening the game→killing proces, and it is still possible to open the game in portrait (my setting is LandscapeLeft)
     
  40. KenDots

    KenDots

    Joined:
    May 26, 2020
    Posts:
    6
    Hello! We just tried upgrading from 2021.3.14f1 where we had this issue, to 2021.3.29f1 (it was supposed to be fixed in .28) and we're still able to get into a state where rotation is not correctly locked to landscape. Our QA has said it is supposedly more difficult to reproduce now, but they still can. Once they can, they can repeatedly rotate the phone between Landscape and Portrait.
     
  41. jperry_oddgames

    jperry_oddgames

    Joined:
    Sep 18, 2017
    Posts:
    62
    As stated in the comment you quoted, the fix was actually in 2022.3.5f1. The issue tracker page incorrectly states that it was fixed in 2022.3.4f1
     
  42. dorisdabao

    dorisdabao

    Joined:
    Jan 5, 2022
    Posts:
    49
    My hub is. cn, and the latest version is only available until 2022.3.4. Do I need to reinstall the. com hub
     
  43. dorisdabao

    dorisdabao

    Joined:
    Jan 5, 2022
    Posts:
    49
    2022.3.6 should indeed fix this bug. I did not reproduce this bug after downloading 2022.3.6f1 using .comHUB
     
  44. dorisdabao

    dorisdabao

    Joined:
    Jan 5, 2022
    Posts:
    49
    Our QA found a new orientation problem. The application Build in 2022.3.6
    When entering the game from LandscapeLeft and executing the code orientation = Portrait, killing the process and entering the game again, it will appear that LandscapeLeft cannot be locked when the game is opened, and can be rotated at All. The environment is IOS16 IPHONE14PRO XCODE14.3.1
     
    Last edited: Aug 10, 2023
  45. dorisdabao

    dorisdabao

    Joined:
    Jan 5, 2022
    Posts:
    49
    May I ask if the orientation BUG has been fixed after upgrading to 2022.3.6?
     
  46. dorisdabao

    dorisdabao

    Joined:
    Jan 5, 2022
    Posts:
    49

    In iphone11 IOS16.3, I didn't reproduce this BUG
     
    Last edited: Aug 10, 2023
  47. jperry_oddgames

    jperry_oddgames

    Joined:
    Sep 18, 2017
    Posts:
    62
    Our QA has now had a chance to test a build using 2022.3.5f1 and unfortunately the problem is still reproducible.
    After a fresh install, holding the device in portrait orientation and then opening the game will incorrectly open it in portrait. This occurs every time on a new install. Each subsequent launch however will correctly be forced into landscape mode.

    While this is an improvement over the previous unity version, we'd still rather avoid having this bug be the first impression of our app for new users.
     
  48. dorisdabao

    dorisdabao

    Joined:
    Jan 5, 2022
    Posts:
    49
    Is there anyone using IOS native code to execute an orientation solution after the game is opened? Is it effective
     
  49. dorisdabao

    dorisdabao

    Joined:
    Jan 5, 2022
    Posts:
    49

    It seems that after executing
    Code (CSharp):
    1. Screen.orientation = ScreenOrientation.AutoRotation;
    , killing the process and then quickly opening the application will cause the problem that the screen cannot be locked when it turns

    My game set is LandscapeLeft
     
  50. dorisdabao

    dorisdabao

    Joined:
    Jan 5, 2022
    Posts:
    49
    Do you use orientation = ScreenOrientation.AutoRotation;