Search Issue Tracker

Fixed in 2022.1.X

Votes

0

Found in

2018.4

2019.4

2020.3

2021.1

2021.2

2021.2.0a15

Issue ID

1335981

Regression

No

[Simulator] Wrong Screen.width/height values returned in OnEnable when reenabling a monobehavior in the editor during PlayMode

Scripting

-

How to reproduce:
1. Open attached project "BadResolution.zip"
2. Open "SampleScene" scene
3. Enter Play Mode
4. Select "Script" Game Object in the Hierarchy window
5. Disable "Find Resolution Printer" component in the Inspector window
6. Enable "Find Resolution Printer" component in the Inspector window
7. Observe the Console window

Expected result: The resolution printed is the same as the resolution printed at the start of the Play Mode
Actual result: The resolution printed is different

Reproducible with - 2018.4.35f1, 2019.4.27f1, 2020.3.9f1, 2021.1.8f1, 2021.2.0a17

  1. Resolution Note (fix version 2022.1):

    Fixed in 2022.1.0a13

    Was not able to fix UnityEngine.Screen behavior, but fixed UnityEngine.Device.Screen behavior to be stable when using Device Simulator. Won't work with Game window and won't work with UnityEngine.Screen.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.