limboai/test/ai/tasks/start_animation.gd

21 lines
364 B
GDScript3
Raw Normal View History

@tool
extends BTAction
@export var animation_name: String
2022-12-16 03:16:19 +00:00
@export var animation_player: NodePath
var _player: AnimationPlayer
func _generate_name() -> String:
return "StartAnimation \"%s\"" % animation_name
func _setup() -> void:
2022-12-16 03:16:19 +00:00
_player = agent.get_node(animation_player)
func _tick(p_delta: float) -> int:
_player.play(animation_name)
return SUCCESS