class_name Interactable extends PhysicsBody3D

signal interacted

@export_group('Interaction settings')
@export var action_label: String
@export var can_be_picked_up: bool = false

@export_group('Visual settings')
@export var visual_mesh: GeometryInstance3D
@export var highlight_material: Material

var highlighted: bool:
	get: return highlighted
	set(val):
		highlighted = val
		set_highlight_material(val)

func set_highlight_material(val: bool):
	visual_mesh.material_overlay = highlight_material if val else null

func interact(interactor: Interactor):
	interacted.emit()
	if interactor and can_be_picked_up:
		interactor.hold_object(self)
