Answer the question
In order to leave comments, you need to log in
How to make a tile in a unit selectable, while different tiles have different properties?
I decided to practice with Tilemaps in Unity, I chose a global strategy like a civilization, with hexes. A map is made using the palette, Tilemap assigned to Tilemap Collider 2d. It is necessary to make it so that when you click on one of the tiles, a Panel with UI pops up, which will display the type of terrain, the state of the cell, etc. In simpler terms, how to make tiles clickable.
Answer the question
In order to leave comments, you need to log in
Tilemaps are not very good for interactive, it's more for creating environments that don't interact with the player. I use normal gameobjects, if the map is very large and there will be a frame/memory drawdown, use the amount that is visible on the camera (+1 at the edges so that they are not cut off in the middle) and move them along with the camera, replacing their properties according to your map .
Or the second option - you can build a tilemap, and then determine with which the player interacts and pull it out of the array (your script) by the coordinates of their properties.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question