Search Issue Tracker
By Design
Votes
2
Found in
2018.4
2019.4
2019.4.8f1
2020.2
2021.1
2021.2
Issue ID
1305990
Regression
No
Time.time returns 0 in OnDisable method when exiting Play Mode in Editor
Reproduction steps:
1. Download and open the attached project 'Time Bug.zip'
2. Open scene 'SampleScene'
3. Enter Play Mode
4. Exit Play Mode after a few seconds
5. Observe Console
6. (Optional) Build and run the project
7. (Optional) Exit the Application
8. (Optional) Open Player.log and observe it's logging on Application Exit (https://docs.unity3d.com/Manual/LogFiles.html)
Expected result: Time.time in OnDisable method returns the time since first entering Play Mode
Actual result: Time.time in OnDisable method returns 0
Reproducible with: 2018.4.30f1, 2019.4.17f1, 2020.2.1f1, 2021.1.0b3, 2021.2.0a2
Notes: Issue was reproduced in Windows Unity Editor but not in Build.
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
- Texture2D hash changes inside of an AssetBundle when rebuilding a SpriteAtlas bundle with an empty AssetPostprocessor Script enabled
- Aniso Level still applies when Generate MipMap is disabled in Texture Import Settings
- Mipmap Limit Groups long names are not truncated when creating a new Mipmap Limit Group with a long name
- “ArgumentException: Invalid double parameter.” error is thrown when Infinity is typed into the Fixed Timestep field
- GameObject becomes gray when using HDRP and STP together on macOS
Resolution Note (2022.2.X):
Currently how the resetting behavior is when leaving play mode. Too high of a risk to change.