> For the complete documentation index, see [llms.txt](https://rsb.inanevin.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://rsb.inanevin.com/getting-started/listening-to-hit-events/spawning-particles-on-hit.md).

# Spawning Particles on Hit

As mentioned before, RSB works with **Object Poolers** to manage object spawning. So it's a good idea to stick with the same methodology in our tutorials. Let's create a new empty game object, name it to **Default Hit Pooler**, then attach the **ObjectPooler.cs** script on this. By clicking to the prefab selection button next to the **Pooled Object** field, select the **Hit Effect Metal** prefab.

![Default Hit Pooler object created, Object Pooler assigned, Hit Effect Metal is selected.](/files/-MaNrL4qEihQaEns_xY8)

Now, let's add a field in our **Tutorial.cs** script to reference to this pooler.

{% embed url="<https://gist.github.com/48dad8629f2ce5da818695eb768645c1.git>" %}

Then, in our **OnAnyHit** method, we will get a new pooled object. Place it to the hit position, make it look at to the hit normal, and enable it.

{% embed url="<https://gist.github.com/519f6f4296e3782e0a395bee513279da.git>" %}

Do not forget to assign the **defaultHitPooler** variable on inspector of our Tutorial object.

![Default Hit Pooler assigned](/files/-MaNgC__QJ1n-YEE25qx)

So, now our whole **Tutorial.cs** script should look like this:

{% embed url="<https://gist.github.com/790c971941503896ae4cedfeaedf0159.git>" %}

Then, if we play and shoot, we will see the default dirt particle is spawned when the bullet hit's the target.

![Metal hit particle gets spawned when the target is hit.](/files/-MaNrB_ScqMj2Yl7TBV4)

{% hint style="info" %}
The hit particles have a deactivator script attached to them. So after they are enabled, they disable themselves after a specific time has passed. As soon as they are disabled, they become available to use in the object pool.
{% endhint %}
