Fix mob playback animation being started before the animation is set in Dodge the Creeps (#1175)

The '$AnimatedSprite2D.play()' is called at the beginning in the '_ready' function,
when it should actually be called at the end, after selecting the animation.
This commit is contained in:
utsav132
2025-03-08 00:13:58 +05:30
committed by GitHub
parent fdb2f50a20
commit 5557b10cfa

View File

@@ -1,9 +1,9 @@
extends RigidBody2D
func _ready():
$AnimatedSprite2D.play()
var mob_types = Array($AnimatedSprite2D.sprite_frames.get_animation_names())
$AnimatedSprite2D.animation = mob_types.pick_random()
$AnimatedSprite2D.play()
func _on_VisibilityNotifier2D_screen_exited():