Recycling Bullets vs Instantiating?!?!?!

So I have heard differing opinions on whether I should recycle bullets, by storing them in an array or vector and reusing them instead of instantiating a copy every time the fire button is pressed… is there really much of a difference, performance-wise?


When it comes to Instantiation, it doesn’t take much to perform.

To keep the instances in the scene in an Array would be a lot, I mean a lot less
cost effective in performance. Even if you’re creating quite a bit of bullets its really worth the 3 lines to instantiate then destroy.

Stick to Instantiate and Destroy. I find performance much better than theoretically storing each instance of an object for a period of time in which users might not need them.

I totally disagree :wink:

Depending on the platform of course, but for iOS and Android, I would definitely recommend to keep the instances hanging around instead of using Instantiate. If you Instantiate and Destroy you will get unpredictable hickups when the Garbage collector does it thing.