Rendering 400 cubes on mobile... Too laggy for mid tier phone!

So i’ve had a problem for the past few days… I am trying to handle having a plane of 400 cubes on mid-tier(?) mobile at 60FPS (Samsung J5 2015). The problem is it needs to allow 20+ cubes to be moved to a new position/material changed every say 10 frames minimum… (Only 2 different materials it can be)

The first approach I spawned 400 prefabs and batched the rendering… This handles 60FPS for a little bit but after a minute or so the phone will heat up and drop to around 40FPS.

Second approach I used the unity MeshCombine function on the 400 cubes after an edit, but this results in upto a 0.10 second freeze in gameplay due to the large amount of cubes.

This was suppose to be a simple project but it quickly became an optimisation headache. I can run all my progress so far easily on an S9 but not on my reference device J5. My last resort is some sort of lower level voxel system but at that point I question whether its worth the time, I haven’t dived into that area yet. Does anyone have any suggestions?

Do you try playing the game at different quality options? It makes a difference in performance. Do your cubes have textures? You might consider using lower quality textures to improve performance. Using LOD also helps if you want to make the cubes look good. Do you have too many rigidbodies? They also affect performance if there are too many. Try optimizing your code, there might be some piece of code which is not efficient, thus causing a decrease in performance. Check the unity profiler and you can narrow down to where the biggest amount of processing is taking place.