UKismetMathLibrary::NotEqual_Vector4Vector4
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Returns true if any component of A and B differ by more than ErrorTolerance. Logical inverse of EqualEqual_Vector4Vector4.
Caveats & Gotchas
- • Like EqualEqual, tolerance is checked per-component, not as a Euclidean distance. A vector pair can be within tolerance on X/Y/Z but still fail on W, causing this to return true unexpectedly when mixing point and direction semantics.
- • Calling this in a tight loop to detect 'any change' is less efficient than caching a dirty flag — each call performs four floating-point subtractions and comparisons.
Signature
static UE_INL_API bool NotEqual_Vector4Vector4(const FVector4& A, const FVector4& B, float ErrorTolerance = 1.e-4f) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| A | const FVector4& | First vector. | — |
| B | const FVector4& | Second vector to compare. | — |
| ErrorTolerance | float | Per-component absolute difference threshold. | 1.e-4f |
Return Type
bool Example
Detect when a direction vector has changed beyond a threshold C++
if (UKismetMathLibrary::NotEqual_Vector4Vector4(PreviousDir, CurrentDir, 0.01f))
{
UpdateShaderParameter(CurrentDir);
PreviousDir = CurrentDir;
} See Also
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?