I have code that collection positions and tiles and then does this:
_walkableTilemap.SetTiles(
walkableTilemapPositions.ToArray(),
walkableTilemapTiles.ToArray()
);
When walkableTilemapTiles hold regular Tiles it works fine however when it hold Rule Tile, nothing happens (no errors but the tilemap is not updated. How do I get rule tiles to work with Tilemap.SetTiles()?
Another weird that I notice if the the rule tiles work if there are up to 4 tiles being updated, once I am at 5 of higher, it then stops working.
// works
var t1 = new Vector3Int[] {
new Vector3Int(6, 5, 0),
new Vector3Int(7, 5, 0),
new Vector3Int(8, 5, 0),
new Vector3Int(9, 5, 0)
};
var t2 = new TileBase[] {
_floorTile,
_floorTile,
_floorTile,
_floorTile
};
_walkableTilemap.SetTiles(t1, t2);
// does not work
var t1 = new Vector3Int[] {
new Vector3Int(6, 5, 0),
new Vector3Int(7, 5, 0),
new Vector3Int(8, 5, 0),
new Vector3Int(9, 5, 0),
new Vector3Int(10, 5, 0)
};
var t2 = new TileBase[] {
_floorTile,
_floorTile,
_floorTile,
_floorTile,
_floorTile
};
_walkableTilemap.SetTiles(t1, t2);
Not sure why this is but thought it might be related so figure I would mention it.