# DrawQueryCastRay

> Draw the PhysicsWorld.CastRay query input.

## Definition

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

## DrawQueryCastRay(CastRayInput, Color, float, bool)

Draw the [PhysicsWorld.CastRay](/engine/6000.5/script-reference/unity/u2d/physics/physicsworld/castray.md) query input.

```csharp
public void DrawQueryCastRay(PhysicsQuery.CastRayInput input, Color color, float lifetime = 0, bool drawEnd = false)
```

### Parameters

**** (\[CastRayInput]\(/engine/6000.5/script-reference/unity/u2d/physics/physicsquery/castrayinput)): The query input to draw.**** (\[Color]\(/engine/6000.5/script-reference/unityengine/color)): The color to draw with.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): How long the element should be drawn for, in seconds. The default is zero indicating that it should only be drawn once. Lifetime is only used when the world is playing.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Whether to draw the arrow at the end of the translation or not.

## DrawQueryCastRay(ReadOnlySpan\<CastRayInput>, Color, float, bool)

Draw the [PhysicsWorld.CastRay](/engine/6000.5/script-reference/unity/u2d/physics/physicsworld/castray.md) query inputs.

```csharp
public void DrawQueryCastRay(ReadOnlySpan<PhysicsQuery.CastRayInput> inputs, Color color, float lifetime = 0, bool drawEnd = false)
```

### Parameters

**** (\[ReadOnlySpan\<CastRayInput>]\(https\://learn.microsoft.com/dotnet/api/system.readonlyspan-1)): The query inputs to draw.**** (\[Color]\(/engine/6000.5/script-reference/unityengine/color)): The color to draw with.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): How long the element should be drawn for, in seconds. The default is zero indicating that it should only be drawn once. Lifetime is only used when the world is playing.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Whether to draw the arrow at the end of the translation or not.
