Skill: Interactables (3D)
Objective
Provide a consistent interaction system for:
- NPC conversations
- signs/plaques
- containers that give items once
Recommended pattern
- Player owns an
InteractionDetector(Area3D) that tracks nearby interactables. - Interactables join group:
interactable - Interactables implement an API (interface-by-convention):
get_prompt() -> Stringinteract(actor: Node) -> void
Steps
- Create a reusable base script
game/scripts/exploration/interactable.gd(class_name Interactable)
- Create interactable scenes
game/scenes/actors/NPC.tscngame/scenes/props/Sign.tscngame/scenes/props/Container.tscn
- Player selection
- On
interactaction:- select nearest interactable in range
- call
interact(self)
Verification
- NPC: shows dialogue and closes cleanly.
- Sign: shows text and closes cleanly.
- Container: adds item and becomes empty after first open.