extends ActionLeaf

@export var patrol_point_group_name: String = "PatrolMarkers"


func tick(actor: Node, _blackboard: Blackboard) -> int:
	var patrol_points: Array[Node] = get_tree().get_nodes_in_group(patrol_point_group_name)
	if len(patrol_points) == 0:
		return FAILURE

	(actor as MechEnemy).target_position = (patrol_points.pick_random() as Node3D).global_position

	return SUCCESS
