Open dreiss opened 2 months ago
This is a bug in the interpolation method of PathFollow rather than a bug in animation. 0 is treated as the end of the loop by the interpolation algorithm at the beginning of the interpolation between 0.3 and 1.0 because PathFollow is looping, although it is stationary at the 0 position between 0.0s and 0.3s. This is probably the cause of the problem.
For now, it is possible to work around this by either disabling loop or setting the values of the 0.0s and 0.3s keys to the miniscule value of 0.001.
Tested versions
Reproduces in 4.2.2 and 4.3 RC3
System information
Fedora Linux, Intel GPU, Compatibility renderer
Issue description
I put a Sprite2D inside a PathFollow2D being driven by an AnimationPlayer. The animation is supposed to "stand still" for 1.5 seconds, then drive the sprite along the path in 0.5 seconds. The result is
https://github.com/user-attachments/assets/d223a65f-446f-4d3f-98f5-5c6898516317
The first frame as the sprite starts to move shows it "jumping" to the end. Then the animation continues as expected.
This only reproduces if the AnimationPlayer's callback_mode_process is physics. It is also sensitive to the time that the motion starts. If the keyframe is moved to 0.3 seconds, it no longer reproduces.
Steps to reproduce
Add this scene to a project and run it.
Minimal reproduction project (MRP)
repro.zip