extends AnimationBase @onready var texture: TextureRect = $TextureRect @onready var animationPlayer: AnimationPlayer = $AnimationPlayer var failIndex: int = 0 var animQueue: Queue = Queue.new() # Called when the node enters the scene tree for the first time. func _ready(): if inverted: attackName = inverseName func castFailed() -> void: queue_free() func setProgress(target: float, final: float = finalProg) -> void: targetProg = target finalProg = final if (index > -1): animationPlayer.queue(attackName + str(index)) index += 1 func animFinished(s: String): if (index == finalIndex): animationFinished.emit(spell) queue_free()