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
- Editor crashes when attempting to connect the client machine to the host machine
- CameraDepthTexture is flipped upside down when URP is rendering without the final blit
- Camera.current returns null when Camera.targetTexture is set to null in OnPostRender
- Crash on BaseHierarchyProperty::Next when opening a specific project
- Shader Compilation for projects with lots of Shaders can be slow (i.e. VFX Graph asset heavy projects)
Resolution Note (2022.2.X):
Currently how the resetting behavior is when leaving play mode. Too high of a risk to change.