2D Endless Runner help.

Hey.

we are currently working on a 2d runner and the game runs fine once its loaded however after about 2 seconds of loading, there is a performance spike across all devices Is there anything that could be causing this ?

All the objects are loaded from prefabs and destroyed once they leave the screen.

Any help on this would be appreciated.

cheers
Jake.

Not sure if this is the cause of your performance issues, but I would highly recommend object pooling.
Constant instantiating/destroying can tax performance especially on mobile devices. Instead spawn the total amount of objects you will need and manipulate their transforms/renderers/etc. This will at least help performance stay more constant so you can better track down the issue(s).

My only other suggestion would be to look around and see if you’re creating far more of something than you first believed.

Beyond that I’m not sure there is enough information here for us to help out much, though hopefully someone with experience can hop in and give a suggestion.