Hello! I’ve been working on different systems in my game (3D RPG) now and a lot of them I’ve been able to resolve with object pooling which is great as I’ve heard it’s generally a better practice than instantiating new objects and then destroying them.
There are a few upcoming systems I want to work on though that I’m not convinced object pooling would be the best solution for though, and so I have some questions about object pooling:
1. Is it possible to object pool objects that have vastly different colliders? For example, if I make a furniture placement system with chairs, lanterns, bowls, tables, etc. Each item has a very different collider, some might have more colliders, and colliders of different types.
2. Can you pool objects with different sets of components? Kinda related to question #1, what is the chair in the furniture system has an interaction component. I would need to add and remove components as I go I guess?
3. Can you pool objects that have intricate systems of child objects? If I make a random dungeon generator that is room based, and each room is different and filled with different child objects, could the rooms be reasonably object pooled?
I totally understand how object pooling is the best choice for repeating identical/similar objects like projectiles, or even enemy spawns, but for something like this I’m not sure sure.
I’m considering using instantiate + destroy methods for my furniture and random dungeon system as it seems like a better choice, but I want to know if there are solutions I’m overlooking here.
Mostly I hesitate because I’ve heard that you should always avoid destroying objects if they can be re-used, but again, I’m just not sure how I would cleanly avoid that with the furniture and dungeon generation system.