RealDocs

UKismetMathLibrary::BreakVector

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

Description

Decomposes an FVector into its three individual double components. This is the Blueprint 'Break Vector' node.

Caveats & Gotchas

  • In C++ there is no reason to call this function; access InVec.X, InVec.Y, InVec.Z directly. The function exists exclusively to expose the NativeBreakFunc Blueprint node.
  • Output components are double in UE5. If you need float precision for a legacy API, cast explicitly — silent narrowing to float is not lossless for large world coordinate values.

Signature

static UE_INL_API void BreakVector(FVector InVec, double& X, double& Y, double& Z);

Parameters

Name Type Description Default
InVec FVector The vector to decompose.
X double& Receives the X component.
Y double& Receives the Y component.
Z double& Receives the Z component.

Return Type

void

Example

Extract XY speed from a velocity vector C++
FVector Velocity = Character->GetVelocity();
double X, Y, Z;
UKismetMathLibrary::BreakVector(Velocity, X, Y, Z);
float HorizontalSpeed = (float)FMath::Sqrt(X * X + Y * Y);

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.