RealDocs

UKismetMathLibrary::NotEqual_Vector2DVector2D

function Engine Blueprint Since 4.0
#include "Kismet/KismetMathLibrary.h"
Access: public Specifiers: staticUFUNCTIONBlueprintPure

Description

Returns true if vector A is not approximately equal to vector B, within a per-component tolerance. The tolerance-aware inverse of EqualEqual_Vector2DVector2D.

Caveats & Gotchas

  • The default tolerance of 1e-4 mirrors EqualEqual_Vector2DVector2D. If you're pairing calls, keep tolerances consistent to avoid asymmetric results.
  • Returns true if either component differs by more than ErrorTolerance, not the Euclidean distance. A vector far on one axis but close on the other will still be 'not equal'.

Signature

static UE_INL_API bool NotEqual_Vector2DVector2D(FVector2D A, FVector2D B, float ErrorTolerance = 1.e-4f);

Parameters

Name Type Description Default
A FVector2D The first vector.
B FVector2D The second vector.
ErrorTolerance float The maximum per-component difference for vectors to still be considered equal. 1.e-4f

Return Type

bool

Example

Branch on position change in a tick C++
if (UKismetMathLibrary::NotEqual_Vector2DVector2D(CurrentPos, LastPos, 0.5f))
{
    OnPositionChanged();
    LastPos = CurrentPos;
}

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.