Interaction System
π Overview
The Interaction System allows players to interact with objects in the game world (e.g., items, chests, doors, NPCs) via a defined interface. It supports both single-use and persistent interactions, and can be extended to support complex behaviors (dialogues, puzzles, etc.).
BPI_Interactable (Interface)
Interface that interactable actors must implement.
AC_Interaction (Component)
Component attached to player controller to detect interactable objects.
BPI_ObjectInteraction (Interface)
Interface that is used by the Player Controller to Start or End Interaction with the current object.
AC_Interactable (Component)
Component attached to the Interactable Actor, forwards Interaction events through BPI_Interactable.
π§© Interactable Component
This component enables any actor to become interactable. Attach this to an actor to define how and when players can interact with it. It also forwards events via BPI_Interactable Interface to the owning actor.
π§ Customizable Parameters
InteractionType
Enum: Press / Hold / Mash
InteractionTime
Time required (in seconds) for Hold or Mash interactions
bIsPersistent
If true, interaction can be repeated; otherwise, it's one-time use
bCanInteract
Master toggle for allowing interaction
InteractableName
Name to display in UI
InteractionPrompt
Custom prompt text ("Press E to open", etc.)
MashCountRequired
For Mash interaction: number of presses required
bShowInteractionWidget
If true, shows interaction UI when player looks at the object
AllowedInteractors
Tag-based whitelist of actors allowed to interact
π§© BPI_Interactable β Interaction Interface
BPI_Interactable β Interaction InterfaceThe BPI_Interactable Blueprint Interface is used by the AC_Interactable component to forward interaction events to the owning actor. This allows developers to keep logic modular, clean, and easily override interaction behavior per object. It Supports both authoritative (server) and client-side (local) interaction logic.
π Interface Events
StartInteraction
Called when interaction begins (networked)
EndInteraction
Called when interaction completes (networked)
CancelInteraction
Called if interaction is cancelled (e.g., player walks away)
StartLocalInteraction
Called locally when interaction starts (client-side only)
EndLocalInteraction
Called locally when interaction ends (client-side only)
π§ BPI_ObjectInteraction - Interaction Interface
This interface is used by the Player Controller to start or end interaction with a target object. It ensures interaction requests are cleanly routed to the component layer, with Server and Client event separation for multiplayer support.
π§Ύ Interface Events
Server_StartInteraction
Called by client β sent to server to initiate interaction (authoritative)
Server_EndInteraction
Ends interaction on the server
Client_CancelInteraction
Allows client-side cancellation or feedback
Client_BeginLocalPreview
Called for visual feedback when looking at object
Last updated