- Home /
Making map borders
I need to make a map border around a tilemap. The problem is, every tile is like a field which a player can buy, and the center field is always bought when the game starts. The camera is top down and needs to move only around the bought fields/tiles. For the camera borders, I am trying to make four corners around the bought fields/tiles. How do I find the center point of all the bought tiles and make a border around them?
do you have a screenshot so we can understand the question? is this a GUI display or gameobject tiles?
$$anonymous$$aintain a list or other collection of references to all the bought tiles.
Now, why do you need the center? Are the bought tiles always a nice square shape all together?
$$anonymous$$aybe you don't need the center but you need the $$anonymous$$aximum and $$anonymous$$inimum positions in two axes.
Do you know how to store references to your tiles in a list? Do you know how to find maximum and $$anonymous$$imum values in a list by looping through it?
Yeah, that's what I will try to do, finding the $$anonymous$$imum and maximum in both axes. I stored all my tiles in an array, not list. At first the array was a GameObject[,][,], but then I changed it to Tile[]. Tile is the class of a single tile.
maybe if you show us some code it will be easier to tell you?
Your answer
![](https://koobas.hobune.stream/wayback/20220612125926im_/https://answers.unity.com/themes/thub/images/avi.jpg)