UKismetMathLibrary::Vector_GetAbs
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Returns a copy of the vector with each component replaced by its absolute value: (|X|, |Y|, |Z|). All components of the result are non-negative.
Caveats & Gotchas
- • This operates component-wise, not on the vector's magnitude. The resulting vector may have a different direction than the original.
- • Commonly used to compute distances along individual axes without sign — not for normalizing direction.
- • Equivalent to FVector(FMath::Abs(A.X), FMath::Abs(A.Y), FMath::Abs(A.Z)) written inline.
Signature
static UE_INL_API FVector Vector_GetAbs(FVector A); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| A | FVector | The input vector. | — |
Return Type
FVector Example
Compute per-axis difference distance C++
FVector Delta = TargetPos - CurrentPos;
FVector AbsDelta = UKismetMathLibrary::Vector_GetAbs(Delta);
// AbsDelta.X, .Y, .Z now contain the unsigned distance along each axis Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?