fix: forces immediate animation start in order to avoid 'flashing' or delayed start

This commit is contained in:
Duncan Brown
2022-07-19 18:27:26 -04:00
parent 0944f601f4
commit c30d109645

View File

@@ -95,7 +95,9 @@ func play(name: String, backwards: bool = false):
_animation_player.seek(0)
elif not _is_animation_player:
_animated_sprite.frame = 0
_current_animation = name
if backwards and _is_animation_player:
_animation_player.play_backwards(name)
elif backwards:
@@ -103,6 +105,10 @@ func play(name: String, backwards: bool = false):
else:
_player_node.play(name)
# Instead of waiting for the next frame, start the animation now.
if _is_animation_player:
_player_node.advance(0)
# Play the given animation backwards
#