Only 1 object for object pools?

Was trying to have multiple types of enemies in a wave, but was running into an issue so came back and watched some other tutorials and realized that each pool was only doing a singular game object.

So should I only be using one Gameobject per object pool and if I wanted different types of enemies I should create an ObjectPool for each different type of enemy?

Hi,

The idea behind an object pool is to be able to take objects out of it instead of creating and destroying objects each time. We don’t search it for a specific object but take the “first” object from the pool.

If you have multiple types of enemies, it makes sense to have multiple pools. If you don’t have to distinguish between your enemies, you could put all enemies into one pool.

Is this what you wanted to know? :slight_smile:


See also:

More or less, thought there was some kind of check but must have a different topic. While it is probably possible to do what I am thinking of doesn’t mean its efficient or a good idea.

Thanks for you help.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms