> 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/effect-handlers/ray-handler.md).

# Ray Handler

![This laser beam is controlled by a Ray handler script](/files/-MW597xcBaaBpt__ncaf)

This component controls a [Line renderer](https://docs.unity3d.com/Manual/class-LineRenderer.html) to work as a laser. It uses a [Physics Raycaster](https://docs.unity3d.com/Packages/com.unity.ugui@1.0/manual/script-PhysicsRaycaster.html) to determine if the laser hits something. Resizes the line renderer to match the raycast result.

Note: Rays can be only controlled by a Ray Handler.

* **Play On Awake:** activates the effect on awake.
* **Delay:** how long (in seconds) before the laser becomes visible after activation.
* **Line Renderer:** Line renderer that represents the laser.
* **Spark Particle:** A particle that appears at the end of the laser where it hits something.
* **Max Distance:** How far can the laser extends.
* **Obstacle Layer Mask:** You can ignore certain layers that do not interrupt the laser beam.

![](/files/-MVvGvfp9-Z0DyNfOKsb)


---

# 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/effect-handlers/ray-handler.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.
