So yay! I finally built to my phone and I’m noticing a slight pause in the gameplay when their is a new wave of enemies spawned.
I know that it is from my instantiating them. So I need to change that into an array of enemy game object held off screen, and the spawner needs to pull from that array. However. How does that work?
I remember someone telling me about this “first one in, last one out” system. But I’ve done a search and so far I can’t find even a mention of this system, let alone an example of how it works.
what you are looking for is objects pool. in object pool you pre create the objects and then just enable them when you need them. when you done you disable them and they return to the pool.
You guys both helped me at roughly the same time, with roughly the same amount of help and set me on the path! So you two need to arm wrestle or flip a coin to see who gets it!
Thanks to both of you. Object pooling now rings a bell and I'll look into both those articles!
– Rick74No problem =) Remember to tick one of us as the correct answer if we helped. @haim96 provided more and better links, so I recommend his answer. =)
– GameVortexYou guys both helped me at roughly the same time, with roughly the same amount of help and set me on the path! So you two need to arm wrestle or flip a coin to see who gets it!
– Rick74I pick Heads.
– GameVortexFlip a coin for us. :)
– haim96