@tool
class_name GrabTarget extends ActionLeaf
## Grab the given target!!
##
## Returns FAILURE if there is no valid key at the given target.

## Blackboard key of the grab target.
@export var blackboard_key := "target"


func tick(_actor: Node, blackboard: Blackboard) -> int:
	@warning_ignore("unsafe_cast")
	var target := blackboard.get_value(blackboard_key) as Node3D
	if not is_instance_valid(target):
		return FAILURE

	# TODO
	print_debug("GET FUCKIGN GRABBED IDIOT!! ", target)

	return SUCCESS
