Search Issue Tracker
Won't Fix
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 Game view and Scene view fail to render when launching the Editor with a maximized Render Graph Viewer window
- "List is empty" is poorly visible in the "Create Node" window
- [Android] GameObject with a custom shader becomes invisible when deployed with the Vulkan Graphics API
- “ReferenceError: Pointer_stringify is not defined” error is thrown when downloading a file
- GameObjects are not rendered when using a fragment shader with RWStructuredBuffer in URP
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.