xiandie/scene/ground/script/general/autoplay_animated_sprite.gd

9 lines
158 B
GDScript

extends AnimatedSprite2D
func _ready() -> void:
if animation:
# 制造一点错差
frame = randi() % sprite_frames.get_frame_count(animation)
play()