# CastRay(CastRayInput)

> Check if a ray intersects the shape. See PhysicsQuery.CastResult.

## Definition

* **Type:** Method
* **Namespace:** [Unity.U2D.Physics](/engine/6000.7/script-reference/unity/u2d/physics.md)
* **Assembly:** UnityEngine.PhysicsCore2DModule

```csharp
public PhysicsQuery.CastResult CastRay(PhysicsQuery.CastRayInput castRayInput)
```

### Parameters

**** (\[CastRayInput]\(/engine/6000.7/script-reference/unity/u2d/physics/physicsquery/castrayinput)): The configuration of the ray to cast.

### Returns

| Type                                                                                       | Description                                        |
| ------------------------------------------------------------------------------------------ | -------------------------------------------------- |
| [CastResult](/engine/6000.7/script-reference/unity/u2d/physics/physicsquery/castresult.md) | The intersection details, if any, that were found. |
