> For the complete documentation index, see [llms.txt](https://traps.runemarkstudio.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://traps.runemarkstudio.com/traps/trap-mechanism/trap-launcher.md).

# Launcher

![](/files/-MW4rdHq_TmAHFs_tddC)

This component shoots a projectile using object pooling. In short, it only instantiates a number of projectiles then reuses the already instantiated. This is good for performance. ([more information here](https://learn.unity.com/tutorial/object-pooling)).

* **Play Mode:** the projectile is spawned and launched Only once or continuously (Loop).
* **Cooldown:** the time (in seconds) between two spawn events.

![](/files/-MW4d_7CCHIhMK6gRISg)

**Launcher Settings**

* **Force:** the force that is applied to the projectile
* **Max Distance:** projectile deactivates and returns to the pool after this distance even if it didn’t collide with anything.
* **Ammunition:** you can limit how many times the launcher can shoot. 0 means unlimited ammo.
* **Stick on Collision:** the projectile will stick to and move with the object it collides with. It disappears when the object pooler reuses it. Useful for arrows or darts.

**Projectile Settings**

* **Projectile:** The script can handle multiple **projectile prefabs**.  By default, it shoots the listed projectiles one by one, based on their order. Enable the Randomize option for random selection.
* **Pool Size:** the script will instantiate only this amount of projectile from each prefab.

### Trap Projectile

This component moves the projectile. It’s inherited from a [Damage Source](https://runemarkstudio.com/deadly-dungeon-traps/documentation/damage-system/), so you can set the damage.

![](/files/-MW4eTVR43KfB723zZRr)

To create a **projectile prefab** to be used in the launcher, simply attach this script to a game object and save as a prefab in your Project folder.

![](/files/-MW4fD6W5aL1IAE25_Wp)
