UKismetMathLibrary::Vector_IsZero
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Returns true only if all three components are exactly zero. Useful for sentinel/initialisation checks, not for floating-point arithmetic results.
Caveats & Gotchas
- • This is an exact integer-zero test with no tolerance. Any accumulated floating-point error — even from a single arithmetic operation — will cause the check to fail even when the value is conceptually zero. Use Vector_IsNearlyZero for values derived from computation.
- • FVector::ZeroVector == (0,0,0) in bit representation, so this reliably identifies vectors explicitly set to FVector::ZeroVector or default-initialised to zero.
Signature
static UE_INL_API bool Vector_IsZero(const FVector& A); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| A | FVector | The vector to test. | — |
Return Type
bool Example
Detect uninitialized target location C++
// TargetLocation is FVector::ZeroVector when unset
if (!UKismetMathLibrary::Vector_IsZero(TargetLocation))
{
MoveToLocation(TargetLocation);
} Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?