Cleaner instantiate code

I am working on a game that I hope to put on Android phones. The game is simple, cubes fall from the sky and build a tower all around you, you must climb the tower and avoid being crushed.

My issues started when I tested the bare bones game on the phone. Once the cubes start to fall it starts to lag until it becomes unplayable.

Up to now I have been using instantiate to create the cubes, I’ve found many people online saying not to do this, but not providing examples of an alternative. I tried to preload a group of cubes and cycle them through, but to preload enough cubes to do the job can sometimes cause the game to crash.

Is there a better way to spawn many objects during runtime.

download attachment and attach to game object that you want …[5381-script.txt|5381]