Runtime Level Editor performance

I’m creating a tile based 2D level editor, going to be similar to what you can see in Broforce so the full level/terrain will build up from many “squares”.

I will need to modify these runtime (change sprites, destruct object, etc.)
I started to implement this storing these tiles as prefabs in a two dimensional array, so I can easily grab and modify them runtime. My question: how will it affect performance? Is it safe to do this way or there is a better workaround for this? Thanks!

Having every tile as a GameObject is a bad idea because you end up with zillions of objects (unless the levels are tiny), and the performance will be poor. You need to use as few objects as possible; the main methods I know of are 1) create meshes using the Mesh class, or 2) use an object pool.

–Eric

Thanks for your answer. I’ve tested the performance on my android device with more than enough tiles I need for one level and it ran flawlessly, and because my target platform is PC, I think I found my answer. :slight_smile: