Instantiating a gameobject causes a lagspike

I am developing a 2.5D mobile game and i seem to have a problem when the game instantiates the boss after X points. The boss is obviously a heavier gameobject than the rest of the enemies as it has a bigger script, more colliders and more audio clips with it. The mob runs fine but the problem is the instantiation itself as it causes a split-second lagspike when it does it. The game instantiates many mobs every second without a problem so its infact the boss that causes it, weirdly even on an empty scene where other enemy spawners are deactivated… There are also no particles upon spawning, nor animation so I really don’t know what it could be.
Thanks in advance!

There’s a lot of things it could be, however a better solution might be to simply spawn the object at the start of the scene and set it to inactive. Whenever you’re ready to use it, move the object to the spawn position and then set it to active. The “lag spike” will then just be part of the game loading the scene instead of interrupting gameplay, and you can keep the boss the same as you currently desire.

If you’re on mobile it might be worthwhile to look into doing this for all your instanciated objects to save on CPU usage. It’s a strategy called Object Pooling if you’d like to learn more about it.

Use an Object Pool and cache your game objects rather than instantiating them at runtime.