RealDocs

ACharacter::NotifyActorEndOverlap

function Engine Since 4.0
#include "GameFramework/Character.h"
Access: public Specifiers: virtual

Description

Called when another actor stops overlapping this character. ACharacter overrides this to decrement the internal overlap event counter.

Caveats & Gotchas

  • Always call Super::NotifyActorEndOverlap() — failing to do so leaves NumActorOverlapEventsCounter mismatched, which can cause movement component encroachment checks to behave incorrectly.
  • End-overlap can fire even if the overlap started on a different frame or due to actor destruction, so OtherActor may be in the process of being destroyed — check IsValid() before using it.

Signature

virtual void NotifyActorEndOverlap(AActor* OtherActor)

Parameters

Name Type Description Default
OtherActor AActor* The other actor that stopped overlapping with this character.

Return Type

void

Example

Track actors leaving an area C++
void AMyCharacter::NotifyActorEndOverlap(AActor* OtherActor)
{
    Super::NotifyActorEndOverlap(OtherActor); // REQUIRED
    if (IsValid(OtherActor))
    {
        OverlappingActors.Remove(OtherActor);
    }
}

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.