RealDocs

UKismetSystemLibrary::BoxOverlapActorsWithOrientation

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

Description

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

Caveats & Gotchas

  • BoxExtent is a half-extent, not the full box size — the same convention as FCollisionShape::MakeBox.
  • OutActors is explicitly documented as unsorted, so don't rely on hit order for anything distance-related even after rotating the query box.

Signature

static ENGINE_API bool BoxOverlapActorsWithOrientation(const UObject* WorldContextObject, const FVector BoxPos, FVector BoxExtent, FRotator Orientation, const TArray<TEnumAsByte<EObjectTypeQuery> > & ObjectTypes, UClass* ActorClassFilter, const TArray<AActor*>& ActorsToIgnore, TArray<class AActor*>& OutActors)

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.
BoxExtent 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.
ActorClassFilter UClass* If set, only actors of this class or subclasses are returned.
ActorsToIgnore const TArray<AActor*>& Actors excluded from the results.
OutActors TArray<AActor*>& Returned array of overlapping actors. Unsorted.

Return Type

bool

Example

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

TArray<AActor*> ActorsToIgnore;
TArray<AActor*> OverlappingActors;
UKismetSystemLibrary::BoxOverlapActorsWithOrientation(this, GetActorLocation(), FVector(200.f, 100.f, 100.f), GetActorRotation(), ObjectTypes, nullptr, ActorsToIgnore, OverlappingActors);

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.