RealDocs

UKismetSystemLibrary::BoxOverlapComponentsWithOrientation

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

Description

Finds every primitive component whose collision overlaps the given box at an arbitrary world-space orientation.

Caveats & Gotchas

  • Extent is a half-extent (center-to-face), matching FCollisionShape::MakeBox.
  • ComponentClassFilter only filters the returned array — the underlying OverlapMultiByObjectType query still runs against every ObjectTypes channel regardless of the filter, so a broad ObjectTypes list against a large box can be costly even when the filter narrows the final results to a handful of components.

Signature

static ENGINE_API bool BoxOverlapComponentsWithOrientation(const UObject* WorldContextObject, const FVector BoxPos, FVector Extent, FRotator Orientation, const TArray<TEnumAsByte<EObjectTypeQuery> > & ObjectTypes, UClass* ComponentClassFilter, const TArray<AActor*>& ActorsToIgnore, TArray<class UPrimitiveComponent*>& OutComponents)

Parameters

Name Type Description Default
WorldContextObject const UObject* Object used to resolve which UWorld to run the query in.
BoxPos const FVector Center of the box in world space.
Extent FVector Half-extents of the box (center-to-face distance on each axis).
Orientation FRotator World-space rotation of the box.
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

Query a rotated box for components C++
TArray<TEnumAsByte<EObjectTypeQuery>> ObjectTypes;
ObjectTypes.Add(UEngineTypes::ConvertToObjectType(ECC_WorldDynamic));

TArray<AActor*> ActorsToIgnore;
TArray<UPrimitiveComponent*> OverlappingComponents;
UKismetSystemLibrary::BoxOverlapComponentsWithOrientation(this, GetActorLocation(), FVector(200.f, 100.f, 100.f), GetActorRotation(), 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.