Question by
Cress7 · Dec 27, 2015 at 07:02 PM ·
2dgameobjectspawninfinite runnerscroller
Best approach to many gameobjects on screen?
Hi everybody, I'm making a 2D infinite scroller game and I'm wondering about how I could spawn coins or obstacles on the screen without making the game lag. I read something about object pools, is it a good approach in my case? Considering that I use a script to scroll the background and collectables/obstacles to the left and the background only moves to the right after reaching a point to make it look like it's infinite, how could I spawn the objects in the right place?
I'm sorry for all the questions but I'm still new to Unity and I never made a game like this, I hope you understood what I'm trying to achieve.
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612054032im_/https://answers.unity.com/themes/thub/images/avi.jpg)