# Tilemap isometric offset

Hi Guys

Wondering if anyone can help, been starting to try to make an isometric game. Got my tilemap setup followed the instructions. I’ve been try to generate a map over the top of the tilemap but every time it seems to be offset. Anyone got any ideas what I’m missing?

``````private void Start()
{
OnGridCellCreated += CreatePrefabOverlay;
CreateGrid();
}

private void CreatePrefabOverlay(Vector3Int position)
{
var cellPosition = _tilemap.GetCellCenterWorld(position);
var tile = Instantiate(overlayTile, transform);
tile.transform.position = new Vector3(cellPosition.x, cellPosition.y, cellPosition.z);
}

private void CreateGrid()
{
BoundsInt cellBound = _tilemap.cellBounds;
gridMap = new Dictionary<Vector2Int, GridCell>();

for (int z = cellBound.max.z; z > cellBound.min.z; z--)
{
for (int y = cellBound.min.y; y < cellBound.max.y; y++)
{
for (int x = cellBound.min.x; x < cellBound.max.x; x++)
{
var tileLocation = new Vector3Int(x, y, z);
var tileKey = new Vector2Int(x, y);
if (!_tilemap.HasTile(tileLocation)) continue;
var cell = new GridCell(x, y, z);

if (gridMap.ContainsKey(tileKey)) continue;
OnGridCellCreated?.Invoke(tileLocation);
}
}
}
}
``````

Hi, I am not quite sure what the individual elements of your Tilemap should look like (eg. Sprite, Prefab, Tile) when placed in cells separately. If you could share that, that would be helpful!

Presumably, you would like to align the cells to the Grass portion of your Sprites? The Sprite could have its pivot set to the bottom of the Dirt portion rather than the bottom of the Grass portion.

Yes I’m expecting the mapping to be positioned on top of the tilemap like this:

I’ve changed the pivot point of the white tile and the pivot point of the tilemap and the pivot point of the grass but nothing seems to get me to the right positioning

Could you share the pivot points of the Sprites you are using?

These are the two sprites that I am using with both at center pivot point:

The pivot of the Grass Sprite is set to the bottom area of the Grass. For your indicators to match, their pivots must be at the same visual location. For your White Sprite, its pivot needs to be set to the bottom center. For the Yellow target, its pivot needs to be set to the bottom center and shifted a little upwards to the top of the shadow.

I’ve set the tile to the bottom center but I’m still a fraction off:

That seems odd, especially if you set up the yellow target indicator the same way.

Could you select the White Sprite/Tile in your SceneView and share screenshots of its Inspector here?