How to get custom data from a tile
I'm trying to make a simple 2D platformer using Unity's tilemap system. To do this I need to be able to tell what type of tile a player is standing on. For example if the player is standing on a 'fire' tile I want to be able to use OnCollide to query the tile type and then do something fire related. Literally all I want to do is add an int or an enum to flag the tile type.
I'd prefer not to have to make a custom gameobject/prefab brush as I want to make use of the basic tile system that's already provided and I'm not sure how much extra functionality I'd have to add to a custom prefab to make it work like the basic tiles.
It seems you can add custom data to a scriptable rule tile, which would be ideal but I can't figure out how to get that data back out.
Is there any way to do this?
Thanks
Your answer
![](https://koobas.hobune.stream/wayback/20220612162154im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Network how to synchronize large tilemap that's made up of bits 0 Answers
Help with tile palette(Genuine Struggle) 0 Answers
How do I use my own MapTile class for a TileMap? 1 Answer
Tile Palette not showing new Tiles 0 Answers
What is causing this issue with Tilemap.SetTile and Update method? 0 Answers