extends XRController3D

var grabTarget: NodePath = NodePath()
var grabbing = false
@export var physicsHand: RigidBody3D

@onready var hinge = physicsHand.get_node("HingeJoint3D")

func _on_input_float_changed(action_name: String, value: float) -> void:
	if action_name == "grip":
		if value >= 0.5:
			grab(true)
		else:
			grab(false)



func _rigid_body_entered(body: Node) -> void:
	grabTarget = body.get_path()

func _rigid_body_exited(body: Node) -> void:
	grabTarget = NodePath()
