RealDocs

UKismetMathLibrary::GetAbs2D

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

Description

Returns a copy of the 2D vector with the absolute value applied to each component. Useful for distance comparisons where sign is irrelevant.

Caveats & Gotchas

  • Returns a new vector rather than modifying in place — the original is unchanged.
  • Does not normalize the vector; components larger than 1 remain larger than 1 after the abs operation.

Signature

static UE_INL_API FVector2D GetAbs2D(FVector2D A);

Parameters

Name Type Description Default
A FVector2D Input 2D vector.

Return Type

FVector2D

Example

Ensure positive component extent for a 2D bounding check C++
FVector2D Offset = FVector2D(-30.f, 15.f);
FVector2D AbsOffset = UKismetMathLibrary::GetAbs2D(Offset);
// AbsOffset == (30, 15)

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.