This commit is contained in:
2025-05-15 16:57:41 -05:00
parent 7f61528100
commit 930463fc2c
4 changed files with 9 additions and 6 deletions

View File

@@ -0,0 +1,21 @@
class_name ItemOnGround extends StaticBody3D
func _ready() -> void:
$Entity/EntityInteractable.onInteract.connect(
self.onEntityInteract
)
func _exit_tree() -> void:
$Entity/EntityInteractable.onInteract.disconnect(
self.onEntityInteract
)
func onEntityInteract(
interactor:EntityInteractor,
interactee:EntityInteractable
) -> void:
ITEM.PLAYER_INVENTORY.addItem(ITEM.ONION);
# Dispose self
get_parent().remove_child(self)
self.queue_free()