UPrimitiveComponent::OnComponentEndOverlap
#include "Components/PrimitiveComponent.h"
Access: public
Specifiers: UPROPERTYBlueprintAssignable
Description
Delegate fired when a previously overlapping component stops overlapping. Paired with OnComponentBeginOverlap.
Signature
FComponentEndOverlapSignature OnComponentEndOverlap Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| OverlappedComponent | UPrimitiveComponent* | This component. | — |
| OtherActor | AActor* | The actor that stopped overlapping. | — |
| OtherComp | UPrimitiveComponent* | The specific component on the other actor. | — |
| OtherBodyIndex | int32 | Index of the physics body. | — |
Caveats & Gotchas
- • Also fires when the overlapping actor is destroyed mid-overlap — OtherActor may be invalid (pending kill) when the event fires. Always IsValid() check.
- • Does not fire if the component itself is destroyed. Cleanup logic that depends on end-overlap should be placed in EndPlay/BeginDestroy as a fallback.
Example
Restore speed on exit C++
void ASpeedZone::OnOverlapEnd(UPrimitiveComponent* Comp, AActor* OtherActor,
UPrimitiveComponent* OtherComp, int32 OtherBodyIndex)
{
if (ACharacter* Char = Cast<ACharacter>(OtherActor))
{
Char->GetCharacterMovement()->MaxWalkSpeed /= 2.0f;
}
} Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?