class_name ThrowBallAction extends ActionLeaf func before_run(actor, _blackboard): actor.play_throw_animation() func tick(actor, blackboard): if !actor.is_throw_animation_finished: return RUNNING else: var target = blackboard.get_value("target") actor.throw_ball(target) actor.has_thrown_ball = true return SUCCESS func after_run(actor, _blackboard): actor.animation_player.play("idle")