RealDocs

AActor::GetOverlappingComponents

function Engine Blueprint Since 4.0
#include "GameFramework/Actor.h"
Access: public Specifiers: UFUNCTIONBlueprintCallable

Description

Populates an output array with all UPrimitiveComponents from other actors that are currently overlapping any component of this actor. The array is reset before population.

Signature

void GetOverlappingComponents(TArray<UPrimitiveComponent*>& OverlappingComponents) const

Parameters

Name Type Description Default
OverlappingComponents TArray<UPrimitiveComponent*>& Output array filled with components currently overlapping any component of this actor.

Return Type

void

Caveats & Gotchas

  • Returns components from *other* actors — not this actor's own components.
  • Requires at least one component on this actor to have 'Generate Overlap Events' enabled.
  • A TSet overload is available in C++ if you need to avoid duplicate entries.

Example

Log all overlapping components C++
TArray<UPrimitiveComponent*> Overlapping;
GetOverlappingComponents(Overlapping);
for (UPrimitiveComponent* Comp : Overlapping)
{
    UE_LOG(LogTemp, Log, TEXT("Overlapping: %s"), *Comp->GetName());
}

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.