# Pool System

**Pooling** is a common technique used to increase performance on games that create and destroy an object multiple times in a short period of time.

{% hint style="success" %}
A common pooling system case is with bullets. A machine gun might shoot 30 bullets per second, which can impact performance, since Unity will have to create and destroy 30 prefabs per second.

To solve this, you can create a **Pool** of bullets (let's say 100) and deactivate all of them. When the machine gun starts shooting, **Game Creator** will pick a deactivated from the pool and use it for the shooting. Once the bullet hits the target, it's deactivated and returned to the pool to later be reused again.
{% endhint %}

**Pooling** in **Game Creator** is very easy. You just need to use the "**Instantiate from Pool**" Action and it will automatically generate a bunch of objects when the first instance is spawned.

{% hint style="info" %}
By default **Game Creator** creates a pool of 20 instances that live up to 10 seconds. You can easily tweak these values adding a "Pool Object" component to your prefab and modifying its parameters.
{% endhint %}

![(Pool Object component)](/files/-Loybcft1lVJGDC6aGm-)

If a **Pool** of a certain object runs out of available objects it will create new instances, increasing the size of the pool.


---

# Agent Instructions: 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:

```
GET https://docs.gamecreator.one/game-creator/systems/pool-system.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
