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
- Frame Count differs in the Frame Debugger after exiting Play Mode with the Frame Debugger Enabled
- VFX System Border text cursor is sometimes not visible
- Hub horizontal scroll hides all items when scrolled to the end
- GC Allocation of 384 B every frame when using CinemachineInputAxisController
- Profiler search results are delayed when any search result is selected, and another frame is viewed
Resolution Note (2022.2.X):
Currently how the resetting behavior is when leaving play mode. Too high of a risk to change.