I followed an example to create a prefab brush because I wanted to add a script to a tile. It seemed to work OK and I can select my new brush and paint with it, but in the script if I check the tile position where I’ve used the prefab brush (using the HasTile method), it returns null. If I do a similar check for other tiles painted using the default brush, it works OK and returns the name of the tile.
Am I doing something wrong here or is it not possible to do what I want? I’ve put some example code below
Vector3Int cell = new Vector3Int(0, 0, 0);
Tilemap tileMap;
tileMap = FindObjectOfType<Tilemap>();
cell.x = 0; cell.y = 0;
if (tileMap.HasTile(cell))
Debug.Log("tile at 0,0 = " + tileMap.GetTile(cell).name);
else
Debug.Log("tile at 0,0 = null");