The IsZeroLength
property of the Vector2Int
struct indicates whether the length of the vector is zero. This property is useful for quickly checking if a vector is effectively a zero vector, meaning both its x and y components are zero.
The IsZeroLength
property of the Vector2Int
struct indicates whether the length of the vector is zero. This property is useful for quickly checking if a vector is effectively a zero vector, meaning both its x and y components are zero.
To use the IsZeroLength
property, simply access it on an instance of Vector2Int
. It returns a bool
indicating whether the vector's length is zero.
Vector2Int vector = new Vector2Int(0, 0); bool isZero = vector.IsZeroLength; // isZero will be true because both x and y components are zero.