Hey guys, I am trying to create a Tile using the new Tilemap system, that when I paint this tile automatically paints other 2 tiles for me.
Think about a tree, I paint the bottom part of the tree and the Tile paints the trunk and the top for me automatically.
I am trying to do this inside the GetTileData method, but everytime I call tilemap.SetTile inside this method and drag the Tile to the pallete Unity crashes.
Anyone knows if this is a bug or if I can’t do this ?
The code I am using is:
public override void GetTileData(Vector3Int position, ITilemap tilemap, ref TileData tileData)
{
Tilemap tilemapInstance = tilemap.GetComponent<Tilemap>();
tilemapInstance.SetTile(new Vector3Int(position.x, position.y - 1, position.z), trunkTile);
tilemapInstance.SetTile(new Vector3Int(position.x, position.y - 2, position.z), topTile);
base.GetTileData(position, tilemap, ref tileData);
}