# GetCellCenterWorld(Vector3Int)

> Gets the logical center coordinate of a Grid cell in world space. The logical center for a cell of the Tilemap is defined by the Tile Anchor of the Tilemap.

## Definition

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

```csharp
public Vector3 GetCellCenterWorld(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) | Returns the center of the cell transformed into world space coordinates. |

### Remarks

In a rectangular grid layout, a call to [GridLayout.CellToWorld](/engine/6000.7/script-reference/unityengine/gridlayout/celltoworld.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 lower left of the cell. This is mathematically correct, but in certain cases such as when instantiating a GameObject into the grid, you may prefer the center of the cell instead.

### Examples

```csharp
 // Snap the GameObject to parent Tilemap center of cell
using UnityEngine;
using UnityEngine.Tilemaps;

public class ExampleClass : MonoBehaviour
{
    void Start()
    {
        Tilemap tilemap = transform.parent.GetComponent<Tilemap>();
        Vector3Int cellPosition = tilemap.WorldToCell(transform.position);
        transform.position = tilemap.GetCellCenterWorld(cellPosition);
    }
}
```
