# CastRay(CastRayInput)

> Perform a raycast against this AABB. Nothing will be detected if the ray starts inside the AABB. To check if the ray starts inside the AABB use PhysicsAABB.OverlapPoint.

## Definition

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

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

### Parameters

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

### Returns

| Type                                                                                       | Description                           |
| ------------------------------------------------------------------------------------------ | ------------------------------------- |
| [CastResult](/engine/6000.5/script-reference/unity/u2d/physics/physicsquery/castresult.md) | The results of the intersection test. |
