RealDocs

UKismetMathLibrary::GetBoxCenter

function Engine Blueprint Since unknown
#include "Kismet/KismetMathLibrary.h"
Access: public Specifiers: staticUFUNCTIONBlueprintPure

Description

Returns the midpoint of an axis-aligned box, computed as the average of its Min and Max corners.

Caveats & Gotchas

  • Exposed to Blueprint as "Get Center (Box)" via a DisplayName meta tag rather than the raw function name.
  • For a box derived from actor bounds this is the origin of the bounding box, which may not match the actor's pivot or root component location.

Signature

static FVector GetBoxCenter(const FBox& InBox)

Parameters

Name Type Description Default
InBox const FBox& The box to measure.

Return Type

FVector

Example

Spawn an effect at the center of a mesh's bounds C++
FBox MeshBounds = MyMeshComponent->Bounds.GetBox();
FVector Center = UKismetMathLibrary::GetBoxCenter(MeshBounds);
UGameplayStatics::SpawnEmitterAtLocation(this, ImpactFX, Center);

Tags

Version History

Introduced in: unknown

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.