RealDocs

UKismetSystemLibrary::ComponentOverlapComponents

function Engine Blueprint Since 4.0
#include "Kismet/KismetSystemLibrary.h"
Access: public Specifiers: staticUFUNCTIONBlueprintCallable

Description

Finds every primitive component whose collision overlaps Component's shape as if it were placed at ComponentTransform, without actually moving Component.

Caveats & Gotchas

  • Same check(Component->GetWorld()) requirement as ComponentOverlapActors — Component must already be registered in a world before calling this.
  • Only Component's own collision geometry is tested; sibling or attached child components on the same actor are not automatically included unless you call this once per component.

Signature

static ENGINE_API bool ComponentOverlapComponents(UPrimitiveComponent* Component, const FTransform& ComponentTransform, const TArray<TEnumAsByte<EObjectTypeQuery> > & ObjectTypes, UClass* ComponentClassFilter, const TArray<AActor*>& ActorsToIgnore, TArray<class UPrimitiveComponent*>& OutComponents)

Parameters

Name Type Description Default
Component UPrimitiveComponent* Component whose collision shape is used for the test.
ComponentTransform const FTransform& Where to place the component's shape for the overlap test.
ObjectTypes const TArray<TEnumAsByte<EObjectTypeQuery> >& Object Types (Project Settings > Collision) to restrict the query to.
ComponentClassFilter UClass* If set, only components of this class or subclasses are returned.
ActorsToIgnore const TArray<AActor*>& Actors whose components are excluded from the results.
OutComponents TArray<UPrimitiveComponent*>& Returned array of overlapping components. Unsorted.

Return Type

bool

Example

Find overlapping components at a proposed placement C++
TArray<TEnumAsByte<EObjectTypeQuery>> ObjectTypes;
ObjectTypes.Add(UEngineTypes::ConvertToObjectType(ECC_WorldDynamic));

TArray<AActor*> ActorsToIgnore;
ActorsToIgnore.Add(GetOwner());

TArray<UPrimitiveComponent*> OverlappingComponents;
FTransform ProposedTransform(FRotator::ZeroRotator, TargetLocation);
UKismetSystemLibrary::ComponentOverlapComponents(CollisionComponent, ProposedTransform, ObjectTypes, nullptr, ActorsToIgnore, OverlappingComponents);

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.