From c30d109645f5910fa560bbc6705526e3339a2a08 Mon Sep 17 00:00:00 2001 From: Duncan Brown Date: Tue, 19 Jul 2022 18:27:26 -0400 Subject: [PATCH] fix: forces immediate animation start in order to avoid 'flashing' or delayed start --- .../escoria-core/game/core-scripts/esc_animation_player.gd | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/addons/escoria-core/game/core-scripts/esc_animation_player.gd b/addons/escoria-core/game/core-scripts/esc_animation_player.gd index 37a1456d..5b347330 100644 --- a/addons/escoria-core/game/core-scripts/esc_animation_player.gd +++ b/addons/escoria-core/game/core-scripts/esc_animation_player.gd @@ -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 #