UKismetMathLibrary::Vector4_IsZero
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Returns true only if all four components of A are exactly 0.0. No tolerance is applied.
Caveats & Gotchas
- • Checks all four components including W. A direction vector that was constructed as (0, 0, 0, 0) will return true, but a point at the origin (0, 0, 0, 1) with W=1 will return false — which may be surprising if you are only checking spatial position.
- • For practical zero-checks on computed vectors, prefer Vector4_IsNearlyZero3 with a tolerance. Exact zero almost never occurs after arithmetic due to floating-point rounding.
Signature
static UE_INL_API bool Vector4_IsZero(const FVector4& A) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| A | const FVector4& | The vector to test. | — |
Return Type
bool Example
Check whether a vector was left at its default zero state C++
FVector4 Dir; // default-initialized to (0,0,0,0)
if (UKismetMathLibrary::Vector4_IsZero(Dir))
{
Dir = FVector4(0.0, 0.0, 1.0, 0.0); // set a default forward direction
} Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?