UKismetMathLibrary::MakeBoxWithOrigin
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticBlueprintPureUFUNCTION
Description
Builds an axis-aligned bounding box from a center point and a half-extent vector. Equivalent to manually computing Min = Origin - Extent and Max = Origin + Extent, but more readable and sets IsValid to true.
Caveats & Gotchas
- • Extent is the **half-size** of the box, not the full dimensions. Passing full width/height/depth values doubles the intended box size — a very common mistake when converting from bounding sphere radii.
- • The resulting FBox always has IsValid set to true even when Extent is zero, producing a degenerate point-sized box. Many engine overlap queries treat degenerate boxes as valid, so a zero-extent box may still trigger false positives.
Signature
static ENGINE_API FBox MakeBoxWithOrigin(const FVector& Origin, const FVector& Extent); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| Origin | const FVector& | The center location of the bounding box. | — |
| Extent | const FVector& | The half-size of the bounding box along each axis. | — |
Return Type
FBox Example
Build a search volume around an actor C++
FVector Center = MyActor->GetActorLocation();
FVector HalfSize(500.f, 500.f, 200.f);
FBox SearchBox = UKismetMathLibrary::MakeBoxWithOrigin(Center, HalfSize);
// SearchBox now spans 1000x1000x400 units centred on MyActor See Also
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?