22 lines
467 B
GDScript
22 lines
467 B
GDScript
@tool
|
|
extends BTAction
|
|
|
|
@export var target_name: String = ""
|
|
@export var output_var: StringName = &"target"
|
|
|
|
func _generate_name() -> String:
|
|
return "FindTargetByName \"%s\" ➜%s" % [
|
|
target_name,
|
|
LimboUtility.decorate_var(output_var)
|
|
]
|
|
|
|
func _tick(_delta: float) -> Status:
|
|
var node:Node3D = agent.get_tree().root.find_child(target_name, true, false) as Node3D
|
|
|
|
if node == null:
|
|
return FAILURE
|
|
|
|
blackboard.set_var(output_var, node)
|
|
|
|
return SUCCESS
|