RealDocs

UKismetMathLibrary::EqualExactly_VectorVector

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

Description

Returns true if vectors A and B are bitwise-identical (zero tolerance). Use only when vectors have been set programmatically to the same value, not when comparing results of floating-point arithmetic.

Caveats & Gotchas

  • Floating-point arithmetic almost never produces bitwise-equal results even when mathematically equal — two paths to the 'same' vector (e.g. adding then subtracting the same amount) will frequently return false. Use EqualEqual_VectorVector with a tolerance instead.
  • Comparing against FVector::ZeroVector exactly is one of the few safe uses; for anything derived from physics simulation or interpolation, exact equality is unreliable.

Signature

static UE_INL_API bool EqualExactly_VectorVector(FVector A, FVector B);

Parameters

Name Type Description Default
A FVector First vector.
B FVector Second vector.

Return Type

bool

Example

Check if a vector is exactly the zero vector C++
FVector Velocity = MyActor->GetVelocity();
bool bAtRest = UKismetMathLibrary::EqualExactly_VectorVector(Velocity, FVector::ZeroVector);

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.