Description
The Vector2Int.Zero
field is a static, read-only field of the Vector2Int
struct. It represents a vector with both the X and Y components set to 0. This is useful for initializing or resetting vectors to a neutral state where no movement or direction is represented.
Usage
You can use Vector2Int.Zero
whenever you need a vector with no magnitude or direction. It is often used as a default value or to compare against other vectors to check if they are effectively zero.
Example
// Example of using Vector2Int.Zero
Vector2Int position = Vector2Int.Zero;
// Check if a vector is zero
Vector2Int velocity = new Vector2Int(0, 0);
bool isStationary = velocity == Vector2Int.Zero;