> 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)


---

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

```
GET https://traps.runemarkstudio.com/traps/trap-mechanism/trap-launcher.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.
