# 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.](https://2062757973-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MaImivuu1fX5yKbO7hR%2F-MaNTtggshfRuvgrGtof%2F-MaNrL4qEihQaEns_xY8%2Fimage.png?alt=media\&token=cfb57812-fd9b-4add-a883-0a02d3cf1fb2)

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](https://2062757973-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MaImivuu1fX5yKbO7hR%2F-MaNTtggshfRuvgrGtof%2F-MaNgC__QJ1n-YEE25qx%2Fimage.png?alt=media\&token=416e14ca-bf83-450c-b16e-4d0c589dd27d)

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.](https://2062757973-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MaImivuu1fX5yKbO7hR%2F-MaNTtggshfRuvgrGtof%2F-MaNrB_ScqMj2Yl7TBV4%2Fimage.png?alt=media\&token=1d4ecc1d-add7-4684-8e45-56d5639a11d7)

{% 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 %}
