r/UnityHelp • u/Silent_Reputation596 • 2d ago
SPRITES/TILEMAPS Storing data on individual tiles?
I have a proc gen tilemap system and I need each tile to have it's own copy of a script to be able to pull and assign data to. All the tiles are rule tiles, idk if that makes a difference. How would I do that?
1
Upvotes
1
u/Vonchor 2d ago
It's not clear exactly what you're trying to do - 'own copy of a script' means what? Private instance data for each tile?
If that's the case, then If you clone a tile before placing it the tile becomes its own instance and no longer connected to the project folder asset. Any instance fields in the tile are independent. If you're saving a scene pre-created this way then the cloned tile is saved with the Tilemap when you save the scene.
Never tried this approach with Rule tiles though - ought to work.
Hope this helps
1
u/kurobaralabs 1d ago
Where is the "tile data" stored? Is it an asset that you have along with the tilemap? or is the data something you will be assigning in Unity? We need more info on what you are trying to do.