Problems when rendering too many Draw calls

Hello guys,
So i’m using c# and I use a script which keeps spawning objects, these objects come at you and when they are not in the screen anymore they get deleted. I have no problems when running it through Unity but when I play the “build” on the phone it gets really laggy, I think that it can be because of too many draw calls or some issues with the backround sound.

I instantiate 5 objects every 0.75 seconds, and sometimes there are 30 objects on screen.

Could you guys please help me out?

Thank you very much!

Creating and destroying objects is very expensive from a performance point of view.

This should be a classical case when object pooling is really necessary. The idea behind is creating a a system which reuse existing objects instead of instantiating and destroying them. You spawn objects once and you put somewhere else on your scene and when you need one of them you just grab it from there. When a pooled object is not necessary anymore it returns to the pool in order to be use after.

There are a lot of ways of creating them, but according to me one of the best tutorial you may look at is the following:

Object pool tutorial