> For the complete documentation index, see [llms.txt](https://renownedgames.gitbook.io/ai-tree/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://renownedgames.gitbook.io/ai-tree/nodes/tasks/physics/ray-cast.md).

# Ray Cast

Node description and basic instructions

### Description

Casts a ray, from point origin, in direction direction, of length max Distance, against all colliders in the Scene.

Specifying Query Trigger Interaction allows you to control whether or not Trigger colliders generate a hit.

{% hint style="warning" %}
Raycasts will not detect Colliders for which the Raycast origin is inside the Collider.
{% endhint %}

{% hint style="info" %}
**bool** Returns true if the ray intersects with a Collider, otherwise false.
{% endhint %}

**To create it**, right-click on free space in AI Tree inspector and select <mark style="color:purple;">Create Node/Tasks/Physics/Ray Cast.</mark>

This task node has a number of fields, that are highlighted in picture below.

<figure><img src="https://2203000093-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGOxTM7Aj9oiVaIINrEkE%2Fuploads%2Fx1X8p2wSmD7uiS0baLba%2FPhys4.png?alt=media&amp;token=a49f904f-d6a4-433a-a5d3-614d9b146738" alt=""><figcaption></figcaption></figure>

### Fields

| Name                      | Description                                                  |
| ------------------------- | ------------------------------------------------------------ |
| Node Name                 | Name of node                                                 |
| Ignore Abort Self         | Whether node ignores abort self or not                       |
| Origin                    | Origin of the Ray Cast                                       |
| Direction                 | Direction of the Ray Cast                                    |
| Max Distance              | Max length of the cast (by default: *infinity*)              |
| Culling Layer             | Used to selectively ignore colliders when casting a Ray Cast |
| Query Trigger Interaction | Specifies whether this query should hit Triggers             |

### Message

| Name     | Description                                                       |
| -------- | ----------------------------------------------------------------- |
| Message  | Value of message                                                  |
| Argument | Argument of message in [Blackboard](/ai-tree/basic/blackboard.md) |
