UKismetMathLibrary::Vector4_NormalUnsafe3
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticBlueprintPure
Description
Normalizes the XYZ components without any zero-length check. Faster than Vector4_Normal3 but will produce NaN/Inf if the XYZ magnitude is zero.
Caveats & Gotchas
- • Passing a zero-length or near-zero vector produces NaN results that silently corrupt downstream calculations — only use this when you have already verified the vector is non-zero.
- • W is always set to 0 in the result; the input W is discarded.
Signature
static UE_INL_API FVector4 Vector4_NormalUnsafe3(const FVector4& A); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| A | const FVector4& | The vector to normalize. Must not be zero-length. | — |
Return Type
FVector4 Example
Fast normalize when length is guaranteed C++
// Only safe because Dir is known to be non-zero from physics simulation
FVector4 Dir = Velocity4;
FVector4 UnitDir = UKismetMathLibrary::Vector4_NormalUnsafe3(Dir); Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?