ALimenTrigger
Overview
ALimenTrigger is an abstract actor class designed to handle collision events within a defined area. It inherits from ALimenGameplayActor and uses a UBoxComponent for detecting overlaps and hits. The class provides public functions to interact with the trigger component and overrides several lifecycle events to handle these interactions.
Properties
Type | Name | Access | Description |
|---|---|---|---|
TObjectPtr | CollisionComponent | Private | The box component used for collision detection. |
Functions
Return Type | Signature | Description |
|---|---|---|
UBoxComponent* | GetCollisionComponent() const | Returns the |
void | BeginPlay() override | Initializes the trigger and sets up event bindings. |
void | ComponentBeginOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult) | Called when another actor begins overlapping with the trigger. Logs a message indicating overlap has begun. |
void | ComponentEndOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex) | Called when another actor ends overlapping with the trigger. Logs a message indicating overlap has ended. |
void | ComponentHit(UPrimitiveComponent* HitComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit) | Called when another actor collides with the trigger. Logs a message indicating a collision has occurred. |
Usage & Implementation Notes
Threading Constraints: None.
Replication Requirements: None.
Memory Lifetime Management: The
CollisionComponentis managed by Unreal Engine's garbage collection system.Initialization Dependencies: The
CollisionComponentmust be created and configured in the constructor to ensure it is ready for use.