ACharacter::NotifyActorBeginOverlap
#include "GameFramework/Character.h"
Access: public
Specifiers: virtual
Description
Called when another actor begins overlapping this character. ACharacter overrides this to increment an internal overlap event counter used for movement queries.
Caveats & Gotchas
- • Always call Super::NotifyActorBeginOverlap() — ACharacter's override increments NumActorOverlapEventsCounter which the movement component relies on to detect encroachment.
- • This is called on both client and server unless your project restricts overlap generation to the server only via collision settings.
Signature
virtual void NotifyActorBeginOverlap(AActor* OtherActor) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| OtherActor | AActor* | The other actor that started overlapping with this character. | — |
Return Type
void Example
Detect pickup overlap C++
void AMyCharacter::NotifyActorBeginOverlap(AActor* OtherActor)
{
Super::NotifyActorBeginOverlap(OtherActor); // REQUIRED
if (APickup* Pickup = Cast<APickup>(OtherActor))
{
Pickup->OnCollected(this);
}
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?