UKismetMathLibrary::NotEqual_VectorVector
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Returns true if vectors A and B differ by more than ErrorTolerance on any component. The robust inequality check for floating-point vector comparisons.
Caveats & Gotchas
- • Like EqualEqual_VectorVector, the tolerance is checked per component independently — two vectors can be within tolerance per axis yet represent significantly different 3D positions depending on your coordinate scale.
- • A common mistake is comparing positions with the default tolerance of 1e-4 cm when you actually care about differences of several centimeters; always pass an explicit tolerance when the threshold is gameplay-meaningful.
Signature
static UE_INL_API bool NotEqual_VectorVector(FVector A, FVector B, float ErrorTolerance = 1.e-4f); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| A | FVector | First vector. | — |
| B | FVector | Second vector. | — |
| ErrorTolerance | float | Maximum per-component absolute difference still considered equal. | 1.e-4f |
Return Type
bool Example
Check if a moving actor has drifted from its target C++
FVector Target = PatrolTarget->GetActorLocation();
FVector Current = MyActor->GetActorLocation();
if (UKismetMathLibrary::NotEqual_VectorVector(Current, Target, 50.f))
{
// More than 50 cm away — keep moving
} Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?