> For the complete documentation index, see [llms.txt](https://docs.forge3d.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.forge3d.com/sci-fi-effects/pool-manager.md).

# Pool Manager

## What is object pooling?

Object pooling is where you pre-instantiate all the objects you'll need at any specific moment before gameplay — for instance, during a loading screen. Instead of creating new objects and destroying old ones during gameplay, your game reuses objects from a “pool”.

{% hint style="info" %}
Check out [**Introduction to Object Polling**](https://learn.unity.com/tutorial/introduction-to-object-pooling) from Unity Learn
{% endhint %}

## **Pool Manager basics**

The Pool Manager allows you to toggle between a collection of pools and contains a lot of useful innovations such as load balancer, a scriptableObject database and separate settings for each pool.

![](/files/-MAkt8iGT1XklAK4Q_rZ)

It’s highly suggested to switch to the optimized despawn in code:

**Despawn(Transform obj, Transform objTemplate)**  – it will significantly increase the despawn productivity. Moreover, the more prefabs, the greater the gain.

For example, if there were about 300 prefabs, 200 objects each – than a regular despawn would have taken a significant time to skim through all spawned objects. But thanks to the advanced despawn it will only go through the ones of the same type as objTemplate. So, the total gain is getting close to about 300 times faster!

## **Pool** **Manager Overview**

### Database

The changes are serialized within a database under the  *Assets/Resources/F3DPoolManagerCache/* ; hence a separate set of pools per level, as well as a project, is possible by design. Creating a database is easy: type the database name and click “Create Database”

### **Pool**

Next to the Database is a popup list which will toggle between the available pools. Click the “Create Pool” button to add one beforehand. Each pool contains the options affecting the designated prefab set, hence allowing as much of abstraction and control:

**Initial parenting** – Will parent all prefab instances to the Pool game object upon initialization

**Runtime sorting** – Will parent a particular prefab instance to the Pool game object upon despawn to ensure its returned to its original parent to prevent the direct use of  the SetParent which affects performance significantly

**Broadcasting** – Calls the specified method name for every spawn and despawn event on the certain game object or any of its children.

#### **By the default, the Pool will instantiate all prefabs in the first frame, but you can change this behavior referring to the following options:**

**Load control** – The pool will limit the number of objects instantiated according to the maximum amount specified per frame

**Load balancer** – Toggling the option will try to keep the target FPS through limiting the quantity of instantiated objects per frame dynamically

**Debug** – Shows details about the results of running internal commands. It can be especially useful when a verbose console output is required.

**Prefab items** – total quantity of prefabs in the pool

### **Prefab**

**Base** – The minimum number of a particular instances created during the initialization

**Max** – The maximum amount of a particular instances allowed in the scene. The pool will ignore any further spawn requests above this value.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.forge3d.com/sci-fi-effects/pool-manager.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
