16 lines
392 B
GDScript
16 lines
392 B
GDScript
class_name EntityInteractableArea extends Area3D
|
|
const Entity = preload("res://overworld/entity/Entity.gd")
|
|
|
|
@export var entity:Entity
|
|
|
|
func isInteractable() -> bool:
|
|
return entity && entity.interactType != Entity.InteractType.NONE
|
|
|
|
func onInteract() -> void:
|
|
if !isInteractable():
|
|
return
|
|
|
|
if entity.interactType == Entity.InteractType.NONE:
|
|
return
|
|
|
|
print("Entity Interacted") |