# Raycast

{% hint style="warning" %}
**NEW GAME MAKER 0.12 INFO COMING SOON!**\
The new release has a lot of amazing features, some of which impact the details on this page. Check back soon for an update, and in the meantime you can see a summary of all the updates in the [Changelog](https://docs.sandbox.game/en/creator/game-maker/version-notes-and-changelogs/game-maker-0.12).
{% endhint %}

{% hint style="success" %}
**COPY/PASTE PARAMETERS**

New in GM 0.11! Right click on a behaviour or component to copy. Then open an object, add the same behaviour or component, and right click it to paste identical parameter settings.
{% endhint %}

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th data-hidden data-card-cover data-type="files"></th></tr></thead><tbody><tr><td>Trigger a message when a precise point is detected.</td><td><a href="https://331512196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F83PS3g9zpWmq73xzlwFn%2Fuploads%2FUybJ2YjCedtr5V3LVVEa%2FGM%20Raycast%20component%20sm%20opt.gif?alt=media&#x26;token=2a2c5905-f272-4d9b-8c46-fdd7a73a6dd9">GM Raycast component sm opt.gif</a></td></tr></tbody></table>

{% hint style="info" %}
[build-singleplayer-and-multiplayer-logic](https://docs.sandbox.game/en/creator/game-maker/docs/build-singleplayer-and-multiplayer-logic "mention") - about <mark style="color:green;">**\[SP]**</mark> or <mark style="color:yellow;">**\[MP]**</mark> behaviours or components
{% endhint %}

## <img src="https://331512196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F83PS3g9zpWmq73xzlwFn%2Fuploads%2FXjsB0XmQ84LIPGXBpyYB%2Fimage.png?alt=media&#x26;token=4953c600-0d5f-4502-ac80-96d3228503fa" alt="" data-size="line"> Raycast <mark style="color:green;">\[SP]</mark> <mark style="color:yellow;">\[MP]</mark>

* Use offset coordinates to create a ray pointing in any direction from the object's pivot point
* Set collision targets
* Send a message when the ray hits a collision target

## Communications

| <p><strong>Inputs:</strong><br>One or more messages</p> | <p><strong>Outputs:</strong><br>Message on hit</p> |
| ------------------------------------------------------- | -------------------------------------------------- |

## Use Cases

* Ranged collisions that do not require a visible projectile
* Guided aiming with visibility turned on
* Ranged detection at a certain point in space (as opposed to detecting an object within an area range using other logic)
* Move the object with Pickable component, the object's gravity settings, or by making it a child object for innovative gameplay

## Parameter Notes

<figure><img src="https://331512196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F83PS3g9zpWmq73xzlwFn%2Fuploads%2FdAL0G1cCdp5OY2SI8tuj%2Fimage.png?alt=media&#x26;token=fca8ff46-9d5e-47b3-a4e5-b23be774f15a" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
The parameter **Is Visble During Game** is a toggle to turn on/off the blue line for the ray so the player can see where it will point and what object(s) it may intersect with when triggered.
{% endhint %}


---

# Agent Instructions: 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://docs.sandbox.game/en/creator/game-maker/docs/components/gameplay/raycast.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.
