I’m making an endless runner. On the sides of the levels I have random buildings that spawn in as the player runs. Should I make a prefab with all 10 buildings inactive and then randomly pick 1 to set active? or should I pick 1 at random and instantiate it?
@okaybj Hi! I also made an endless runner recently, and the approach I took was to instantiate the obstacles off screen, picking one at random from an array. So far I haven’t noticed any performance issues because of this, so I feel like instantiating a random object would be a bit better than having the obstacles already there all at once. I am not a professions, but this it the approach I saw everyone taking, and it works like a charm! Don’t forget to delete them after, though, because if not that will cause a lot of lag.
It is better to have them instantiated at the start and pool them than create/delete them all the time