AnimatedSprite doesn't emit animation_finished
when changing playback direction
#61078
Labels
Milestone
animation_finished
when changing playback direction
#61078
Godot version
3.x (ddc14b6), master (d6e7dcb)
System information
Mageia 9 Linux, x86_64
Issue description
AnimatedSprite
(AnimatedSprite2D
inmaster
) seems to behave differently fromAnimationPlayer
with regard to emitting theanimation_finished
signal when the animation ends, if the playback direction has changed (e.g. starting playing forwards, then playing backwards).In the attached project, the animation is played forward and properly emits
animation_finished
when it ends. Theanimation_finished
callback then plays the animation again but backwards, and there theanimation_finished
signal is not emitted when reaching the end (first frame).Similarly, if starting by playing backwards, then the
animation_finished
signal is properly emitted when it reaches the first frame. But if we then restart the animation forwards, the signal is not emitted when reaching the last frame.So it looks like the way the animation is played the first time defines what the "end" condition is and does not adapt to changes in playback direction. On the other hand,
AnimationPlayer
seems to handle the above scenario fine, and emitsanimation_finished
on the last frame if playing forward, and on the first frame if playing backward.Note:
Loop
should be disabled for theAnimatedSprite
, otherwise it conflicts with the above ping-pong looping implementation.Steps to reproduce
Loop
disabledanimation_finished
is received, play it backwardanimation_finished
is not received when the backward animation endsMinimal reproduction project
3.x
MRP: AnimatedSpriteTest-3.x.zipmaster
MRP: AnimatedSpriteTest-4.0.zipThere's a
backwards
export bool that can be toggled to observe the two behaviors described above.The text was updated successfully, but these errors were encountered: