ULimenProximityInteractionComponent
Overview
ULimenProximityInteractionComponent is a custom component that extends ULimenInteractionComponent. It detects and manages interactions with interactable components within a specified range. The component uses a sphere to detect overlapping actors and updates the list of interactables accordingly.
Properties
Type | Name | Access | Description |
|---|---|---|---|
TObjectPtr | InteractionSphere | Private | Sphere component used for detecting interactions. |
TArray< ULimenInteractableComponent *> | ComponentsInSphere | Private | List of interactable components within the interaction range. |
TArray<AActor*> | ActorsInSphere | Private | List of actors that own the interactable components within the interaction range. |
Functions
Return Type | Signature | Description |
|---|---|---|
const TArray< ULimenInteractableComponent *>& | GetAllInteractablesInRange() const | Returns a list of interactable components within the interaction range. |
const TArray<AActor*>& | GetAllInteractableActorsInRange() const | Returns a list of actors that own the interactable components within the interaction range. |
void | RestartInteraction() override | Restarts the interaction by re-setting up the component. |
void | SetupInteraction() override | Sets up the interaction sphere and registers overlap events. |
void | UpdateInteraction(const float DeltaTime) override | Updates the list of interactables based on current proximity and handles debug drawing if enabled. |
UFUNCTION() | OnInteractionSphereBeginOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult) | Handles the begin overlap event for the interaction sphere. |
UFUNCTION() | OnInteractionSphereEndOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex) | Handles the end overlap event for the interaction sphere. |
bool | IsInsideSphere(const UPrimitiveComponent* InteractableComponent) const | Checks if an interactable component is within the interaction range. |
void | CheckActorsInInsideRadius() | Updates the lists of interactable components and actors based on current proximity in the world. |
Usage & Implementation Notes
Threading Constraints: This component operates on the game thread.
Replication Requirements: None.
Memory Lifetime Management: The interaction sphere is dynamically created and destroyed during setup and teardown.
Initialization Dependencies: Depends on
ULimenInteractionComponentfor base functionality.