Search Issue Tracker
Won't Fix
Won't Fix in 6000.2.X
Votes
0
Found in
2021.3.46f1
2022.3.54f1
6000.0.30f1
6000.1.0a7
6000.2.0a1
Issue ID
UUM-90581
Regression
No
Screen.safeArea returns wrong values when called in Awake upon loading another Scene
Reproduction steps:
1. Open the attached “Test.zip” project
2. Open the “Assets/Scenes/SampleScene“ Scene
3. Enter Play Mode
4. Observe the “awake area=…“ log resolution values in the Console
5. In the Game View window, press the button in the center
6. Observe the new “awake area=…” log values
7. Compare the step 4 and step 6 values
Expected result: The values match and are the same as the Aspect Ratio of the Game View
Actual result: The values in step 7 are different and are dependent on the size of the Game View window
Reproducible with: 2021.3.46f1, 2022.3.54f1, 6000.0.30f1, 6000.1.0a7
Reproducible on: macOS Sequoia 15.1.1
Not reproducible on: Windows 11, Ubuntu 24.04
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- The Up, Down and other Buttons in a Style Sheet's Inspector unselect items when they are clicked while they are disabled
- Virtual Player remains active and still launches when removed from Additional Editor Instances from a custom Play Mode Scenario
- UI Toolkit Editor Window Creator becomes not interactable and greyed out when a long name is entered
- [Web][iOS] Web Player keeps restarting on launch when Native C/C++ Multithreading is enabled
- "Add Scene to Scenes in Build" pop-up reappears after Scene has already been added and another Multiplayer Editor Instance is loaded
Resolution Note:
The getSafeArea method gives incorrect values if called from Awake() during a scene load. This happens because Awake() runs before the new scene is completely ready and platform details are available.This isn't a bug. Awake() is meant for a script's own initial setup and is simply too early to get reliable data that depends on the fully loaded scene.
To get the correct values, call getSafeArea in Start() or a later method, when the scene is guaranteed to be fully initialised.
Resolution Note (6000.2.X):
The getSafeArea method gives incorrect values if called from Awake() during a scene load. This happens because Awake() runs before the new scene is completely ready and platform details are available.This isn't a bug. Awake() is meant for a script's own initial setup and is simply too early to get reliable data that depends on the fully loaded scene.
To get the correct values, call getSafeArea in Start() or a later method, when the scene is guaranteed to be fully initialised.