Home > front end >  How to select a tile from multi tilemap?
How to select a tile from multi tilemap?

Time:02-06

enter image description here

As Image highlighted, I have 3 tilemaps under Grid, the Ground includes only grass, and StopMove only includes walls, now I want to know what tile is user mouseover, I konw I can use Tilemap.getTile() for select tile from a single tilemap, but I don't have idea how to selected a tile from muti tilemaps.

for example, if user's mouse is over grass, I don't think I have to check every tilemaps, so do you have any good way to teach me? Thank you for your help :)

CodePudding user response:

Theoretically, this is what you were looking for. But in a different wrapper. Set it up so that it only selects tiles in this case.

https://answers.unity.com/questions/1009987/detect-canvas-object-under-mouse-because-only-some.html

  •  Tags:  
  • Related