Files
HorrorGame/Assets/scripts/InteractRay.gd
2024-06-09 17:55:34 -05:00

18 lines
404 B
GDScript

extends RayCast3D
@onready var prompt = $"Prompt"
# Called when the node enters the scene tree for the first time.
func _ready():
add_exception(owner)
func _physics_process(delta):
prompt.text = ""
if is_colliding():
var collider = get_collider()
if collider is Interactable:
prompt.text = collider.promt_message
if Input.is_action_just_pressed("interact"):
collider.interact(owner)