preallocate memory? (object pooling)

So I want to create a large amount of simple objects
at startup because basically it’s for editing and you can spawn in alot of these simple objects at once so I don’t want to trash the framerate by using 200 calls to instantiate in one frame.

so I decided to implement an object pooling class that creates them at runtime and has retrieval/return functions.

The issue is the creation itself during void Start()

im not sure if i need to do some kind of heap pre allocation or use a different function even (perhaps awake instead of start?)

But the game throws something called a broadphase entity error (which I gather has to do with basically having a bunch of colliders created all at once)

I do object creation in for loop and after each instantiate I disable the created object but it still gives me an error.

Is there a way I should use to create objects during load as it were.

Please have a look at my simple project. It should do exactly what you need.

This project provides a simple implementation for pool of prefabs to avoid performance issues with runtime prefab instantiation. The source is quite simple and it worked for me. You can tweak code and adapt it to your needs. Check the blog article and doc on GitHub.