# RaySnap(Ray)

> Casts ray against the Scene and reports whether an object lies in its path.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor](/engine/6000.7/script-reference/unityeditor.md)
* **Assembly:** UnityEditor.CoreModule

```csharp
public static object RaySnap(Ray ray)
```

### Parameters

**** (\[Ray]\(/engine/6000.7/script-reference/unityengine/ray)):&#x20;

### Returns

| Type                                                           | Description                                 |
| -------------------------------------------------------------- | ------------------------------------------- |
| [Object](https://learn.microsoft.com/dotnet/api/system.object) | A boxed RaycastHit, null if nothing hit it. |

### Remarks

The `ray` only returns intersections with GameObjects that have a collider component attached to them.
