Search Issue Tracker

Won't Fix

Votes

0

Found in

2022.3.64f1

6000.0.52f1

6000.1.11f1

6000.2.0b9

6000.3.0a1

Issue ID

UUM-110765

Regression

No

Some animator states do not transition after some time passes

-

How to reproduce:
1. Open the “StuckAnimator.zip“ project
2. Open “SampleScene“
3. Enter Play Mode
4. In the Edit > Project settings > Time, change the Time Scale to 100
5. Select the “PJPCumulative“ GameObject in the Hierarchy
6. Wait ~1 hour
7. Afterward, change the Time Scale back to 1
8. In the Animator window, change the 'Lvl' parameter to 2, and observe the Animator and the Game view

Expected results: Active state changes to the corresponding state, the Sprite gets bigger
Actual results: Active state does not change to the corresponding state (unless 0 or 7 is put in 'Lvl' parameter), and the Sprite size does not change

Reproducible in: 2022.1.0a1, 2022.3.64f1, 6000.0.52f1, 6000.1.11f1, 6000.2.0b9, 6000.3.0a1

Reproduced on: Windows 11 Pro (24H2)
Not reproduced on: No other environment tested

Notes:
- Initially user states that you’d need to wait for over 9 hours to reproduce the issue, but I believe this issue depends on the time scale, so the greater it is, the less you’ll have to wait
- The states to which the Animator changes when the 'Lvl' parameter is set to 0 or 7 do not have “Has Exit Time“ checked, so that might be part of the bug

  1. Resolution Note:

    The issue stems from a fundamental problem with floating point numbers: as the numbers get large enough, the smallest representable difference between two numbers increases.

    In this case, the normalized duration of the current state gets large enough that the current normalized time of the state plus the normalized delta time is exactly equal to the current time.

    Therefore, at that point the animation will stop advancing, and any transition which has an exit time will stop working correctly.

    This specific bug is technically fixable. We could ensure that the time increases to the next representable floating point number, but this would be futile, as at that point animation playback would also completely break down as the deltaTime deviates more and more from the actual elapsed deltaTime.

    Instead, if you need an Animator to be in the same state for a very long duration (over 100,000 times the duration of the state in this case), you can periodically use Animator.Crossfade to transition to the same state, but at a normalized time that is more reasonable.

    For example, if the current state's normalized time is 25,000.25, you can Crossfade to the same state, at a normalized time of 0.25.

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.