# GetCellCenterLocal(Vector3Int)

> Get the logical center coordinate of a grid cell in local space.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.7/script-reference/unityengine.md)
* **Assembly:** UnityEngine.GridModule

```csharp
public Vector3 GetCellCenterLocal(Vector3Int position)
```

### Parameters

**** (\[Vector3Int]\(/engine/6000.7/script-reference/unityengine/vector3int)): Grid cell position.

### Returns

| Type                                                              | Description                                                  |
| ----------------------------------------------------------------- | ------------------------------------------------------------ |
| [Vector3](/engine/6000.7/script-reference/unityengine/vector3.md) | Center of the cell transformed into local space coordinates. |

### Remarks

In a rectangular grid layout, a call to [GridLayout.CellToLocal](/engine/6000.7/script-reference/unityengine/gridlayout/celltolocal.md) with [Vector3Int](/engine/6000.7/script-reference/unityengine/vector3int.md) parameter, returns a [Vector3](/engine/6000.7/script-reference/unityengine/vector3.md) coordinate that represents the bottom-left of the cell. This is mathematically correct, but when for example instantiating a GameObject into the grid, you often prefer the center of the cell instead.

### Examples

```csharp
 // Snap the GameObject to parent Grid center of cell
using UnityEngine;

public class ExampleClass : MonoBehaviour
{
    void Start()
    {
        Grid grid = transform.parent.GetComponent<Grid>();
        Vector3Int cellPosition = grid.LocalToCell(transform.localPosition);
        transform.localPosition = grid.GetCellCenterLocal(cellPosition);
    }
}
```
