- Home /
[Mobile] Creating 2d TileMap : Mesh vs SetPixels
Hi guys,
I'm trying to make a rogue like dungeon crawler for Smart Phones here and I'm a bit confused on which method should I use to create the tilemap. The game will generate a RANDOM map every time player enter the dungeon thus I need to create the tilemap procedurally and it can't be a predefined tilemap.
I'm in the middle of using a Mesh and creating new Texture2d using SetPixels, these are my considerations (please CMIIW) :
Mesh : + The vertices is easy to understand and I don't need to create the data grid - This is a 3d method and I'm don't quite understand 3d programming thus I'm afraid that it will gives me problem during the development
SetPixels : + A 2d method - From what I read, the performance is very poor. but please keep in mind that I only need to do this during the dungeon loading
Do you guys think the SetPixels performance will be very bad? I'm leaning toward the SetPixels as I want the whole thing to be on 2D. Please give me your input.
Thanks!
You do what you can do. Either method will likely work, but the SetPixels will be slower and use more memory. If I understand what you are doing correctly, the usual solution is to change the uvs in the mesh to map in different parts of a texture atlas into each quad in the mesh.
Your answer
![](https://koobas.hobune.stream/wayback/20220613153903im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to display a tile map efficiently? 1 Answer
Get size of Transform 1 Answer
2D Tilemap which way to go - memory-wise 1 Answer
TileMap inside a Tilemap 0 Answers