mirror of
https://github.com/godotengine/godot-demo-projects.git
synced 2025-12-31 09:49:06 +03:00
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.
11 lines
258 B
GDScript
11 lines
258 B
GDScript
extends RigidBody2D
|
|
|
|
func _ready():
|
|
var mob_types = Array($AnimatedSprite2D.sprite_frames.get_animation_names())
|
|
$AnimatedSprite2D.animation = mob_types.pick_random()
|
|
$AnimatedSprite2D.play()
|
|
|
|
|
|
func _on_VisibilityNotifier2D_screen_exited():
|
|
queue_free()
|