- Home /
Tilemap - tiles are drawn incorrectly when loaded dynamically in a procedural map script
I have a procedural map script and a custom tile class based on TileBase. Everything works fine except the it is drawing SOME of the tiles incorrectly. I have audited the x/y to make sure I wasn't doing settile incorrectly. This worked fine with square tiles but with hex tiles it is wonky. I am sure it is something little but I have run out of ideas. Any help is appreciated.
Where I set tiles.
foreach (var tile in Tiles)
{
System.Diagnostics.Trace.WriteLine($"{tile.X}-{tile.Y}");
tile.MapSprite = GetBiomeSprite(tile);
BiomeTileMap.SetTile(new Vector3Int(tile.X, tile.Y, 0), tile);
}
See the attachment below for example of some tiles placed incorrectly on a small map corner.
Your answer
![](https://koobas.hobune.stream/wayback/20220612215031im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to make a stickman not dismember itself 0 Answers
How to blur 2D background sprites? 0 Answers
moving player top down,movement in unity 2d 0 Answers
Destroy a gameObject in the scene if instantiate the same gameObject 0 Answers
My 2D Player Can't Move (2d Photon Game) :(,My Player Don't Move (2d Character Controller 0 Answers