AActor::OnActorEndOverlap
#include "GameFramework/Actor.h"
Access: public
Specifiers: UPROPERTYBlueprintAssignable
Description
Multicast delegate fired when another actor stops overlapping this actor. Pair with OnActorBeginOverlap to track when actors enter and exit an overlap region.
Caveats & Gotchas
- • Like OnActorBeginOverlap, both actors must have bGenerateOverlapEvents enabled for this to fire. If only the begin event fires but end never does, check the other actor's overlap settings.
- • EndOverlap is also called when either actor is destroyed while still overlapping — handle the case where OtherActor may be pending kill by checking IsValid(OtherActor) at the start of the handler.
- • When an actor is teleported rather than moved continuously, the engine may not always generate matching Begin/End pairs; test sweep-based teleports carefully.
Signature
UPROPERTY(BlueprintAssignable, Category="Collision")
FActorEndOverlapSignature OnActorEndOverlap Examples
Show an actor again when the player leaves the overlap zone
Blueprint
Bind end-overlap to reset a trigger C++
void AMyTrigger::BeginPlay()
{
Super::BeginPlay();
OnActorEndOverlap.AddDynamic(this, &AMyTrigger::HandleOverlapEnd);
}
void AMyTrigger::HandleOverlapEnd(AActor* OverlappedActor, AActor* OtherActor)
{
if (IsValid(OtherActor))
{
UE_LOG(LogTemp, Log, TEXT("%s left trigger"), *OtherActor->GetName());
}
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?