Object pooling in a tower defense game

Of course… you just Destroy() them.

When you play with object pooling, you basically become the “Inventory Keeper” of all those objects, and you now have to write extra code to do your bidding.

This code has to be meticulously correct from a bookkeeping standpoint or else you get issues like what you see above.

For 99% of games, object pooling is unlikely to make a visible performance difference.

Object pooling can also have a high cost as far as restructuring the lifetime of objects within your game.

It also greatly increases your engineering burden as far as tracking those lifetimes and reasoning about quantities and excesses and everything else associated such that the “inventory keeper” job continues to be done appropriately, even as your game grows and expands going forward.

https://forum.unity.com/threads/object-pooling.1329729/#post-8405055

1 Like