- Home /
How to find sprite at grid location?
Hey! I'm working for the first time with Tilemaps and grids in unity and...well I'm stuck.
I'm currently trying to make a Fire Emblem type of game, but I'm struggling at finding which sprite is present at a X,Y Coordinate in the world. I basically need this to prevent the player from being able to select the cell and move there.. I've looked at the grid / grid layout documentation but was unable to find anything helpful.
I want to check if the ground tile's sprite is red checkered, of so, remove my movement indicators (hollow light blue squares).
Answer by MattG54321 · Dec 29, 2017 at 03:14 AM
Try using Tilemap.GetTile(Vector3Int position).
That's to get a tile from the 'tile palette' tilemap isn't? :o
If you really insist on getting the sprite, you can get it from the tile that GetTile() returns by using .Sprite.