- Home /
Overlay textures in Tilemap
Hello World! I'm generating a Tilemap in Unity. I create a mesh which uses a texture atlas of floor tiles and then manipulate the UVs to display the correct texture. This works just fine. But now I want to display furniture/walls/items, some of them will have some transparent pixels, so it will be impossible to have an atlas for every object-floor combination (If an object is for example 2x2 tiles, under it will be 4 floor tiles, and each one might be different).
So I'm thinking about creating different meshes, one for floors, one for furniture/walls and the last one for items (there may be items on top of furniture) and each one will have its own atlas. Sorting those meshes, so the floor is far away from the camera and the item one is closer (The camera is orthographic) to get the desirable effect.
Is this a good practice or should I do that in another way?
Answer by Remy_Unity · Feb 13, 2018 at 01:03 PM
What you describe seems to be a good practice.
Also, instead of making all by you own, you could use : https://docs.unity3d.com/Manual/Tilemap-CreatingTilemaps.html and it's API : https://docs.unity3d.com/ScriptReference/Tilemaps.Tilemap.html
I didn't know there were an object just for Tilemaps. Thank you for the reference!