- Home /
Delete Tiles Outside of Tile Map
I have a 2D Tilemap and with how my world generation works there are some unwanted results around the edges of the map (thankfully always a predictable and uniform amount). I was wondering how one could go about deleting parts of a tilemap that are outside of a given width/height?
Edit: Here is an image of what is happening. There is a 3 tile outside ring kind of thing that spawns with the tilemap. I was wondering if there is a way to either delete this or prevent this from happening?
Here is the pastebin of the code if perhaps there is a way to just prevent it from happening in the first place. (It creates a ring on each doSim if that helps.) The ring should be getting created in the genTilePos method ~line 80.
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612211017im_/https://answers.unity.com/themes/thub/images/avi.jpg)