# CastRay(CastRayInput, out PhysicsShape)

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

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.LowLevelPhysics2D](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d.md)
* **Assembly:** UnityEngine.Physics2DModule

## CastRay(CastRayInput, PhysicsShape)

```csharp
public PhysicsQuery.CastResult CastRay(PhysicsQuery.CastRayInput castRayInput, out PhysicsShape chainSegmentShape)
```

### Parameters

**** (\[CastRayInput]\(/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsquery/castrayinput)): The configuration of the ray to cast.**** (\[PhysicsShape]\(/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsshape)): A reference to the chain segment shape that the query found.

### Returns

| Type                                                                                                   | Description                                        |
| ------------------------------------------------------------------------------------------------------ | -------------------------------------------------- |
| [CastResult](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsquery/castresult.md) | The intersection details, if any, that were found. |
