As an Associate of Unity Asset Store, this website earns from qualifying purchases & contains affiliate links: check the footer for more info.

Object Pool & Object Pooling System

Object Pool is software design pattern that allows creating objects in advance (e.g., at the scene loading) and then reuse them, what has a positive effect on game performance for Unity Projects.

Object Pooling, Optimization and Performance in Unity

To prevent Garbage Collector issues (CPU Spikes) in games with many spawning and destroying objects, a method called Object Pooling can be used. Object Pooling refers to creating all necessary objects beforehand and disabling/enabling them when it necessary, instead of instantiating (Instantiate() function) and destroying (Destroy() function) objects during runtime.

Object Pool in Unity — Example in Game — Pooling System — Object Pooler — Pool Manager

This is often done by having an array containing disabled objects that are often used, e.g. bullets in FPS or units in a Strategy game. When a gun is fired, instead of spawning a new bullet and allocating memory for it, we take a game object from the list (object pool), move it to the right position & activate it.

When the bullet collides with something, instead of destroying it, we disable it and add it back our object pool in default state to use it later.

This way we can have many objects appear and disappear, without allocating any memory and causing issues with the Garbage Collector.

These objects can also be spawned beforehand during a loading screen and kept hidden until needed. This way they won’t cause performance issues when spawned during gameplay.


Unity Assets

Pool Boss

Pool Boss — the best pooling solution on Unity Asset Store that makes simple to avoid the costly Instantiate() and Destroy() calls that cause performance problems. All types of prefab are supported — even particle systems.

Unity Asset Store — Download Button
Unity Pool Boss — Unity Asset of Pooling System — Pool Manager

One short line of code can despawn or spawn prefabs, or you can use our included Playmaker scripts!

Pool Kit

Pool Kit — Ultimate Object Pool Manager, next generation system for pooling, spawning and despawning with ZERO Garbage Collection which can be up to 77% faster than instantiating (~33% on average) and helps to make your game a smoother experience which is increasingly needed on platforms like mobile, AR and VR!

Unity Asset Store — Download Button
Unity Pool Kit — Unity Asset of Pooling System — Object Pooler

Pool Kit also thinks about how you work in Unity and comes with its powerhouse of a Spawner. This can be used to create enemies in strategy or tower defense game genres, special effects, weapon systems and more!

Random Object Pooler

Random Object Pooler — improved version of the Object Pooling System by Unity Technologies.

Package is a Part of Unity Assets by Makaka Games

Random Object Pooler is available as a part of Complete Project Templates & Tools:

Football (docs) — Unity Asset in the sport arcade genre with realistic physics of football net, goal movement & target movement inside the goal, advanced scoring & audio systems.

Unity Asset Store — Download Button

Basketball Game (docs) — sport arcade with realistic physics of basketball net & ring, ring growing, hoop movement, advanced scoring & audio systems.

Unity Asset Store — Download Button

AR Basketball (docs) — sport arcade for mobile platforms with realistic physics of basketball net & hoop.

Unity Asset Store — Download Button

AR Shooter (docs) — first-person shooter: kill zombies & save your life with full immersion in the game.

Unity Asset Store — Download Button

Throw Object 3D (docs) — highly customizable Advanced Throwing System for Unity. You can throw object forward or in any direction with custom force, a center of mass, and 80+ other throwing parameters. 2 Modes. 2 Demos. 10 Throwing Objects.

Unity Asset Store — Download Button

AR Throw & Score (docs) — Throw AR Object into containers & Try to Get Best Score.

Unity Asset Store — Download Button

Game Examples with Object Pool


Support

First, read the latest docs online.
If it didn’t help, get the support.

Unity Assets

Support for Unity Assets

I am Andrey Sirota, Founder of Makaka Games and full-time Publisher on the Unity Asset Store. First, read the latest docs online. If it didn’t help, get the support.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Comment moderation is enabled. Your comment may take some time to appear.

Back to top button