Vector2Int ComponentMin( Vector2Int other )

book_4_sparkGenerated
code_blocksInput

Description

The ComponentMin method of the Vector2Int struct returns a new Vector2Int where each component is the minimum of the corresponding components of the current vector and the specified other vector. This method is useful for component-wise comparison and selection of the smallest values between two vectors.

Usage

To use the ComponentMin method, call it on an instance of Vector2Int and pass another Vector2Int as the parameter. The method will return a new Vector2Int with each component being the minimum of the two vectors' corresponding components.

Example

Vector2Int vector1 = new Vector2Int(3, 5);
Vector2Int vector2 = new Vector2Int(4, 2);
Vector2Int result = vector1.ComponentMin(vector2);
// result is now (3, 2)