RealDocs

UKismetMathLibrary::VSizeXY

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

Description

Returns the length of a 3D vector projected onto the XY plane, ignoring the Z component. Equivalent to FVector2D(A.X, A.Y).Size().

Caveats & Gotchas

  • Z is discarded entirely. For actors at different heights this returns the horizontal separation only, which is exactly what you want for top-down speed or distance checks.
  • Still involves a square root. Use VSizeXYSquared for comparisons against a threshold to eliminate the sqrt cost.

Signature

static UE_INL_API double VSizeXY(FVector A);

Parameters

Name Type Description Default
A FVector The 3D vector whose XY-plane length to compute.

Return Type

double

Example

Measure horizontal movement speed from a 3D velocity C++
FVector Vel = CharacterMovement->Velocity;
double HorizSpeed = UKismetMathLibrary::VSizeXY(Vel);
// HorizSpeed ignores vertical velocity (falling/jumping)

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.