Skip to content

Interaction Component

Overview

UMIPInteractionComponent manages overlapping interactables and active interaction: overlap tracking, start/end interaction by tag or object, server broadcast of interaction/end, and cycling through overlapping objects. It uses UMIPInteractionInstanceDefinitionAsset and FInteractionTypeStruct for definition data.

Key traits:

  • Attachment: PlayerController.
  • Overlap: Add/remove overlapping objects; cycle current target; get overlapping count.
  • Interaction: Start with last overlapping object or specific object + tag; end interaction (optional internal call); BlueprintNativeEvent OnDoneInteracting.
  • Server: ServerBroadcastInteractionTag, ServerBroadcastEndInteracting so server and other clients can react.

All paths below are relative to Plugins/ModularInventoryPlus/Source/ModularInventoryPlus/.


Key Classes & Files

Class File
UMIPInteractionComponent Public/Interaction/MIPInteractionComponent.h

UMIPInteractionComponent

  • Base: UMIPBasePlayerControllerComponent.
  • Overlap API: OnOverlapped(InOverlappedObject, bShouldAdd), OnEndOverlapped(InEndOverlappedObject), CycleOverlappingObject(), GetOverlappingObjectsNum().
  • Interaction API: StartInteractWithLastOverlappingObject(InTag), StartInteractWithObject(InObject, InTag), EndInteractWithObject(bCallEndInteractWithObjectInternal), OnDoneInteracting(InInteractable, bForceEndOverlap) (BlueprintNativeEvent), OnBackButtonClicked(), GetInteractingObject().
  • Server RPCs: ServerBroadcastInteractionTag(InObject, InInteractionStruct, InInteractionInstanceDefinitionAsset), ServerBroadcastEndInteracting(InObject, bInCallOnClient).
  • Helpers: GetEnabledInteractableInstanceDefAssets(InInteractableDefinitions) – filters by enabled state.
  • Delegates: OnInteractedWithObject, InteractionTagDelegate (begin), EndInteractionTag (end), BeginOverlapping, EndOverlapping.

Integration

  • UMIPItemPickupComponent subscribes to interaction begin/end to start/stop pickup flow.
  • UMIPStoragesManagerComponent uses EndStorageInteractionTags when interaction ends to clear active storage.
  • Interactables implement the interaction interface and register overlap with this component.