Skip to content

Repository files navigation

InteractSystem

Version: 1.0.0
Category: Gameplay Framework
Author: JiRath
License: MIT


Overview

InteractSystem is a comprehensive user interaction orchestration plugin for Unreal Engine that provides end-to-end interaction management across web, mobile, and API touchpoints. The system handles event routing, session management, cross-plugin interaction triggering, and third-party service integration.

Core Purpose

InteractSystem serves as the central interaction hub for the modular plugin ecosystem, enabling seamless communication between players, game objects, and external services through a unified component-based architecture.

Key Capabilities

CapabilityDescription
Interaction ManagementComponent-based system for defining interactable objects and player interaction logic
Inventory SystemFull-featured inventory with stacking, item attributes, and network replication
Equipment SystemItem equipping, unequipping, and usage with visual feedback
Physics InteractionGrab, push, and throw physics objects with configurable parameters
Trigger SystemChain interactions between multiple interactable objects
Toggleable InterfaceOn/off state management for interactive objects
Session ManagementPlayer interaction state tracking and session persistence

Common Use Cases

  1. Item Collection: Players pick up items that are added to their inventory
  2. Door Interaction: Doors that can be opened/closed and trigger other events
  3. Physics Puzzles: Grabbing and moving objects to solve environmental puzzles
  4. Item Usage: Using equipped items on interactable objects (e.g., keys on doors)
  5. Chain Reactions: Triggering multiple objects in sequence (e.g., pressure plates opening doors)

Role in Plugin Ecosystem

InteractSystem is a standalone plugin that provides core interaction functionality. It can be extended to integrate with other plugins in the ecosystem through custom implementation.


Installation

Supported Runtime Environments

EnvironmentMinimum VersionRecommended Version
Unreal Engine5.05.3+
Windows1011

Step-by-Step Setup

  1. Copy Plugin Files

    Copy the InteractSystem folder to YourProject/Plugins/
    
  2. Regenerate Project Files

    # Windows
    YourProject.uproject - GenerateProjectFiles.bat
  3. Build the Project

    # Using Unreal Build Tool
    RunUAT.bat BuildCookRun -project=YourProject.uproject -noP4 -platform=Win64 -clientconfig=Development -serverconfig=Development
  4. Enable Plugin in Editor

    • Open Project Settings → Plugins
    • Enable "InteractionSystem"
    • Restart the editor

Dependencies

ModuleVersion ConstraintRequired
Core>= 5.0Yes
CoreUObject>= 5.0Yes
Engine>= 5.0Yes
InputCore>= 5.0Yes
DeveloperSettings>= 5.0Yes
NetCore>= 5.0Yes
GameplayTags>= 5.0Yes
Slate>= 5.0No (Editor only)
SlateCore>= 5.0No (Editor only)

Configuration

Configurable Parameters

ParameterData TypeDefault ValueValid RangeEnvironment VariableSecurity Notes
InteractDistancefloat500.010.0 - 10000.0 cmINTERACT_DISTANCENone
bAutoEquipbooltruetrue / falseINTERACT_AUTO_EQUIPNone
GrabWeightThresholdfloat25.00.1 - 1000.0 kgINTERACT_GRAB_WEIGHTNone
PushImpulsefloat100000.0100.0 - 1000000.0INTERACT_PUSH_IMPULSENone
MaxInventorySlotsint32501 - 1000INTERACT_MAX_SLOTSNone
bEnablePhysicsGrabbooltruetrue / falseINTERACT_PHYSICS_GRABNone
TriggerDelayfloat0.00.0 - 60.0 secondsINTERACT_TRIGGER_DELAYNone

Configuration File Example

[/Script/InteractionSystem.InteractableComponent]InteractDistance=500.0
bAutoEquip=true
[/Script/InteractionSystem.InventoryComponent]MaxInventorySlots=50

Security Considerations

  • Network Replication: All inventory and interaction state changes are server-authoritative
  • Input Validation: Item data is validated before being added to inventory
  • Memory Safety: Uses Unreal's garbage collection for all UObject references

Usage

Basic Interaction Setup

// C++ - Adding interaction to an actor
#include"Interaction/InteractableComponent.h"// In your actor class headerUPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Interaction")
UInteractableComponent* InteractableComponent;
// In your actor constructor
InteractableComponent = CreateDefaultSubobject<UInteractableComponent>(TEXT("Interactable"));
// Blueprint - Event-driven interaction// 1. Add InteractableComponent to your actor// 2. Bind to OnInteract event// 3. Implement custom logic in the event graph

Inventory Management

// C++ - Adding items to inventoryvoidAMyActor::AddItemToInventory(UItemInformation* ItemInfo, int32 Quantity)
{
FItemData NewItem;
NewItem.ItemInformation = ItemInfo;
NewItem.Count = Quantity;
FItemHandle Handle;
if (InventoryComponent->AddToInventory(NewItem, Handle))
{
UE_LOG(LogTemp, Log, "Item added successfully");
}
}
// C++ - Checking inventory contentsvoidAMyActor::PrintInventory()
{
TArray<FInventoryContents> Items;
InventoryComponent->GetInventory(Items);
for (const FInventoryContents& Item : Items)
{
UE_LOG(LogTemp, Log, "Item: %s, Count: %d", *Item.GetItemInformation()->DisplayName.ToString(),
Item.ItemData.Get<FItemData>().Count);
}
}

Public API Reference

UInteractorComponent

MethodSignatureDescription
Interact()void Interact()Initiates interaction with the currently hovered interactable
FinishInteract()void FinishInteract()Completes a continuous interaction
GetHoveredPrimitive()UPrimitiveComponent* GetHoveredPrimitive() constReturns the currently hovered primitive component
InteractWith()void InteractWith(UPrimitiveComponent* Component)Interacts with a specific component

UInteractableComponent

MethodSignatureDescription
Interact()void Interact(const AActor* Interactor, USceneComponent* Component)Called when an interactor interacts with this component
FinishInteract()void FinishInteract(const AActor* Interactor, USceneComponent* Component)Called to finish a continuous interaction
IsPlayerInteractable()bool IsPlayerInteractable() constChecks if the object can be interacted with
GetInteractType()EInteractType GetInteractType() constReturns the interaction type (SingleUse/Continuous)

UInventoryComponent

MethodSignatureDescription
AddToInventory()bool AddToInventory(const FItemData& Item, FItemHandle& OutItemHandle)Adds an item to the inventory
RemoveFromInventory()void RemoveFromInventory(const FItemHandle& ItemHandle)Removes an item by handle
RemoveItemFromInventory()void RemoveItemFromInventory(const FItemData& Item)Removes a specific item type
GetInventory()void GetInventory(TArray<FInventoryContents>& OutInventory) constGets a copy of the inventory array
CanAddToInventory()bool CanAddToInventory(const FItemData& Item) constChecks if an item can be added
EmptyInventory()void EmptyInventory()Removes all items from inventory
GenerateUniqueHandle()FItemHandle GenerateUniqueHandle()Creates a new unique item handle

UEquipComponent

MethodSignatureDescription
EquipItem()void EquipItem(const FItemHandle& Item)Equips the specified item
UnequipItem()void UnequipItem()Unequips the currently equipped item
ToggleEquippedItem()void ToggleEquippedItem(const FItemHandle& Item)Toggles item equipment state
UseItem()void UseItem()Uses the currently equipped item
GetEquippedItem()FItemHandle GetEquippedItem() constReturns the currently equipped item handle
HasItemEquipped()bool HasItemEquipped() constChecks if an item is equipped

UTriggerComponent

MethodSignatureDescription
TriggerActors()void TriggerActors(AActor* Instigator, UPrimitiveComponent* Component)Triggers all configured interactables

UPhysicsGrabComponent

MethodSignatureDescription
GrabComponent()void GrabComponent(UStaticMeshComponent* GrabMesh, FHitResult Hit)Grabs a physics object
ReleaseComponent()void ReleaseComponent()Releases the grabbed object
PushComponent()void PushComponent(UStaticMeshComponent* GrabMesh)Pushes a physics object
PhysicsInteract()void PhysicsInteract()Initiates physics-based interaction

Events and Delegates

EventSignatureDescription
OnUpdateHoverFUpdateHoverCalled when the hovered primitive changes
OnInteractFInteractCalled when an interaction occurs
OnFinishInteractFFinishInteractCalled when an interaction finishes
OnInventoryChangeFInventoryChangeCalled when inventory contents change
OnItemAddFItemAddCalled when an item is added
OnItemRemoveFItemRemoveCalled when an item is removed
OnUpdateEquipStateFUpdateEquipStateCalled when equipment state changes
OnPushObjectFPushObjectCalled when push state changes

Troubleshooting

Common Error Codes

CodeMessageResolution
EIS-1001"Interaction failed: No interactable in range"Ensure the interactable is within InteractDistance and bIsPlayerInteractable is true
EIS-1002"Inventory full: Cannot add item"Increase MaxInventorySlots or remove existing items
EIS-1003"Item not found in inventory"Verify the item handle is valid and the item exists
EIS-1004"Physics grab failed: Object too heavy"Reduce GrabWeightThreshold or use a lighter object
EIS-1005"Network error: Server rejected interaction"Check server authority and network permissions
EIS-2001"Item data validation failed"Ensure UItemInformation asset is valid and properly configured
EIS-2002"Equip failed: No item equipped"Equip an item before attempting to use it

For agent-specific guidance, see AGENTS.md. Last updated: 2026-05-21

About

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages