extends Node3D
@onready var animation_player = $AnimationPlayer
var animations = ["CAE", "POLI", "COJO"]
var current_animation_index = 0
var time_since_last_animation = 0.0
const ANIMATION_CHANGE_INTERVAL = 5.0
func _ready() -> void:
# Start with the first animation
animation_player.play(animations[current_animation_index])
pass
func _process(delta: float) -> void:
time_since_last_animation += delta
if time_since_last_animation >= ANIMATION_CHANGE_INTERVAL:
time_since_last_animation = 0.0
# Move to the next animation
current_animation_index = (current_animation_index + 1) % animations.size()
animation_player.play(animations[current_animation_index])
pass
No hay comentarios:
Publicar un comentario