Interaction & Prompt System

A reusable Unity interaction layer for raycast-based object detection, player prompts, mission terminals, weapon pedestals, and world objects that expose simple interaction behavior through interfaces.

System Overview

This system lets the player look at usable objects, see a prompt, press interact, and let the object decide what happens.

What It Does

The Interaction & Prompt System gives Echo Systems Lab a reusable way to connect the player to world objects. Instead of hardcoding terminal logic, weapon pickup logic, and prompt text directly inside the player controller, interactable objects expose their behavior through a shared interface.

The player interactor casts forward from the camera, checks for an interactable target, shows the correct prompt, and calls the target’s interaction method when the player presses the interact input. This lets objects like mission terminals, weapon pedestals, and future puzzle devices each own their own response.

The result is a clean interaction pipeline that is easy to extend. New interactable objects can be added without rewriting the player controller or duplicating prompt logic.

Primary Role

Detect usable world objects, show player-facing prompts, and route interaction input into object-owned behavior.

Core Loop

Look at object → Detect interactable → Show prompt → Press interact → Object handles action.

Portfolio Value

Demonstrates interface-based architecture, player UI feedback, input routing, and reusable world interaction design.

Interaction System Snapshots

Screenshot references for prompts, interactable setup, mission terminal use, weapon pedestal pickup flow, and object-owned behavior.

Unity gameplay screenshot showing a weapon pedestal interaction prompt visible while the player looks at the pedestal

Weapon Pedestal Prompt

The player receives a readable prompt when looking at an interactable weapon pedestal.

  • Prompt UI
  • Weapon Pedestal
  • Interactable
Unity gameplay screenshot of the mission terminal opened through the interaction system

Mission Terminal Interaction

The same interaction path can open mission UI, proving the system is not limited to pickups.

  • Terminal
  • Mission UI
  • World Object
Unity Inspector screenshot of PlayerInteractor showing camera reference, interact distance, layer mask, prompt UI reference, and debug values

Player Interactor Setup

The interactor owns detection range, raycast setup, prompt connection, and input-triggered interaction routing.

  • Raycast
  • Detection
  • Inspector Setup
Unity Inspector screenshot of InteractPromptUI showing prompt root and TextMeshPro prompt text references

Prompt UI

Prompt display is separated from interactable behavior so the UI can be reused across many object types.

  • TextMeshPro
  • Prompt Display
  • UI Layer
Unity Inspector screenshot of WeaponData used by an interactable weapon pickup or pedestal

Object-Owned Data

Interactable objects can reference data assets, allowing the interaction system to stay generic.

  • Data Driven
  • WeaponData
  • Reusable Flow
Unity gameplay screenshot of the Echo Systems Lab hub environment where interactable objects are placed in the world

Hub World Usage

The hub uses interactable objects to connect environment exploration with mission flow and gameplay setup.

  • Hub
  • World Objects
  • Player Flow

Interaction Flow

The player interactor is the scout, the prompt is the signpost, and the interactable object is the tiny machine behind the curtain.

1. Player Looks Forward

The interactor casts from the player camera to find usable objects in front of the player.

2. Raycast Finds Target

The hit object is checked for an IInteractable implementation on itself or its parent object.

3. Prompt Text Updates

If the object can be interacted with, the prompt UI displays the object’s interaction message.

4. Player Presses Interact

The input reader reports an interact press and the player interactor calls the target’s interaction method.

5. Object Handles Behavior

The mission terminal can open UI, while a weapon pedestal can equip a weapon and hide its visual.

6. Prompt Clears Safely

When the player looks away, interaction becomes unavailable and the prompt hides.

Key Components

Each script owns one slice of the interaction pipeline so the system stays flexible and calm instead of becoming spaghetti confetti.

IInteractable

A shared interface for world objects that can provide prompt text and respond when the player interacts.

  • Interface
  • Loose Coupling
  • World Objects

PlayerInteractor

Performs raycast detection, tracks the current interactable target, updates prompts, and forwards interact input.

  • Raycast
  • Input Routing
  • Prompt State

InteractPromptUI

Shows and hides the prompt root and updates the TextMeshPro prompt message.

  • Prompt
  • TextMeshPro
  • UI Feedback

Mission Terminal

Uses the interaction system as the player-facing entry point into mission selection and unlock flow.

  • Mission UI
  • Terminal
  • Hub Flow

Weapon Pedestal

Lets a mission present a weapon in the world, respond to interaction, equip the player, and update pedestal visibility.

  • Weapon Equip
  • Pedestal
  • Trial Setup

Future Interactables

The same interface can support doors, switches, terminals, elevators, pickups, puzzle props, tutorial signs, and test devices.

  • Expandable
  • Reusable
  • Tool Friendly

Design Notes

The important design decision is that the player finds interactables, but the interactable decides what interaction means.

Why Use an Interface?

Without an interface, the player controller would need to know about every possible object type: mission terminals, weapon pedestals, doors, pickups, puzzle objects, and future trial props. That turns the player script into a junk drawer with a keyboard.

With IInteractable, the player only asks a simple question: “Can this object be interacted with?” If the answer is yes, the object provides prompt text and handles its own behavior.

This keeps the player-side code generic and lets each object own its unique interaction response. It also makes the system easier to test because prompt display, raycast detection, and object behavior are separate concerns.

Generic Detection

The player interactor does not need to know what kind of object it found.

Object-Owned Behavior

Each interactable object owns its action, prompt message, and setup data.

Expandable Hub

New terminals, pickups, and trial objects can be added without rewriting player interaction logic.

Related Systems

The interaction layer connects directly into mission selection, weapon equipment, input, and progression.

Mission Terminal & Unlock Flow

Uses interaction to open the terminal and route the player into available missions.

Weapon Data & Loadout

Uses interactable pedestals and pickups to equip mission weapons and expand player loadouts.

Input & Keybindings

Supplies the interact button input while letting menus safely disable gameplay actions.