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 Debugger is not disabled when switching Scenes if the Frame Debugger window is not open during the transition
- Standalone Profiler Targets another Project if a Standalone Profiler was launched in it before when switching between Edit or Play Mode Targets
- Crash on ForwardRenderLoopJob when opening a specific project
- [Android] Memory leak and eventual crash on Snapdragon 8 Gen 1+ devices when a Clear Pass is executed after Framebuffer Fetch
- PhysicsRaycaster ray length is incorrect when casting from rotated Camera
Resolution Note (2022.2.X):
Currently how the resetting behavior is when leaving play mode. Too high of a risk to change.