# Vector2Int.SnapToGrid

```csharp
Vector2Int SnapToGrid(int gridSize, bool sx = True, bool sy = True)
```

Snap to grid along any of the 2 axes.

### Parameters

- `gridSize` (`int`)
- `sx` (`bool`), default `True`
- `sy` (`bool`), default `True`

### Returns

`Vector2Int`

Declared in [Vector2Int](/api/Vector2Int).
Assembly: `Sandbox.System`.
