Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Equals

Compares two vectors to each other and evaluates if they are equal.
Read time 1 minuteLast updated 4 days ago

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule

Equals(Object)

Compares two vectors to each other and evaluates if they are equal.
public override readonly bool Equals(object other)

Parameters

other

The object to compare against this vector.

Returns

Type

Description

bool
true
if
other
is a Vector4 that is exactly equal to this vector, otherwise
false
.

Remarks

Due to floating point inaccuracies, this might return false for vectors which are essentially (but not exactly) equal. Use the == operator to test two vectors for approximate equality.

Equals(Vector4)

Compares two vectors to each other and evaluates if they are equal.
public readonly bool Equals(Vector4 other)

Parameters

other

The vector to compare against this vector.

Returns

Type

Description

bool
true
if the given vector is exactly equal to this vector, otherwise
false
.

Remarks

Due to floating point inaccuracies, this might return false for vectors which are essentially (but not exactly) equal. Use the == operator to test two vectors for approximate equality.

Equals(Vector4)

Compares two vectors to each other and evaluates if they are equal.
public readonly bool Equals(in Vector4 other)

Parameters

other

The vector to compare against this vector.

Returns

Type

Description

bool
true
if the given vector is exactly equal to this vector, otherwise
false
.

Remarks

Due to floating point inaccuracies, this might return false for vectors which are essentially (but not exactly) equal. Use the == operator to test two vectors for approximate equality.