17 lines
418 B
GDScript
17 lines
418 B
GDScript
class_name BasicNPCEntity extends CharacterBody3D
|
|
|
|
@export var interactEvent:Event = null
|
|
|
|
func _ready() -> void:
|
|
$Entity/EntityInteractable.onInteract.connect(
|
|
self.onEntityInteract
|
|
)
|
|
|
|
func onEntityInteract(
|
|
interactor:EntityInteractor,
|
|
interactee:EntityInteractable
|
|
) -> void:
|
|
if interactEvent == null || interactEvent.started:
|
|
return
|
|
interactEvent.onEntityInteract(interactor, $Entity/EntityInteractable)
|