Interaction

The Interaction System provides a data-driven framework for defining and executing interactions between game entities. An Interactor (e.g., a character) interacts with an Interactable (e.g., a door, NPC, workbench) by executing an Interaction — an async action resolved through an InteractionTable that filters by triggers and conditions.

Architecture

spinner

Data Flow

spinner

Key Concepts

Concept
Description

Interactable

MonoBehaviour placed on interactive GameObjects. Holds an InteractionTable and manages outline highlighting.

Interactor

Serializable object attached to entities that can initiate interactions (characters, NPCs).

Interaction

Abstract Action subclass defining the async logic of a specific interaction (e.g., sit, pick up, talk).

InteractionTable

Serializable list of InteractionContext entries attached to an Interactable.

InteractionContext

Glue object binding an Interaction to its triggers and conditions. Manages execution lifecycle.

InteractionTrigger

Abstract matcher that determines how an interaction is initiated (e.g., click, proximity, key press).

InteractionCondition

Abstract evaluator that determines whether an interaction is available in a given context.

Interaction Lifecycle

spinner

Quick Start

Creating a Custom Interaction

Triggering an Interaction by Type

Triggering via InteractionTrigger

Subsystems

Folder
Description

Abstract trigger matching for interaction initiation

Condition evaluation for interaction availability

Glue binding interactions to triggers and conditions

Reflection-based input binding for player-controlled interactions

Classes

Class
Description

MonoBehaviour component for interactive GameObjects

Abstract base class for interaction logic

Serializable collection of interaction contexts

Entity that initiates interactions

Abstract trigger matching base class

Last updated