How can I re-animate the same sprite?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By marcorexo

Hi,

When I try to re-animate the same sprite using sprite.play() it no longer animates. For example, in this code snippet I restart the animation using a timer which gives the sprite enough time to animate (3 frames) so that I don’t need to use sprite.stop() :

func _on_Timer_timeout():
   sprite.play()
   timer.start()

How can I re-play the same sprite? How can I solve this? Is it better practice to use sprite.stop()?