# DrawQueryResult

> Draw the PhysicsQuery.CastResult returned from multiple queries. Only a result where _hit is true is drawn.

## Definition

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

## DrawQueryResult(CastResult, Color, float, bool, bool)

Draw the [PhysicsQuery.CastResult](/engine/6000.5/script-reference/unity/u2d/physics/physicsquery/castresult.md) returned from multiple queries. Only a result where \_hit is true is drawn.

```csharp
public void DrawQueryResult(PhysicsQuery.CastResult result, Color color, float lifetime = 0, bool drawPoint = true, bool drawNormal = true)
```

### Parameters

**** (\[CastResult]\(/engine/6000.5/script-reference/unity/u2d/physics/physicsquery/castresult)): The result to use.**** (\[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 point in the result or not.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Whether to draw the normal in the result or not.

## DrawQueryResult(ReadOnlySpan\<CastResult>, Color, float, bool, bool)

Draw the [PhysicsQuery.CastResult](/engine/6000.5/script-reference/unity/u2d/physics/physicsquery/castresult.md) returned from multiple queries. Only a result where \_hit is true is drawn.

```csharp
public void DrawQueryResult(ReadOnlySpan<PhysicsQuery.CastResult> results, Color color, float lifetime = 0, bool drawPoint = true, bool drawNormal = true)
```

### Parameters

**** (\[ReadOnlySpan\<CastResult>]\(https\://learn.microsoft.com/dotnet/api/system.readonlyspan-1)): The results to use.**** (\[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 point in the result or not.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Whether to draw the normal in the result or not.

## DrawQueryResult(WorldCastResult, Color, float, bool, bool)

Draw the [PhysicsQuery.WorldCastResult](/engine/6000.5/script-reference/unity/u2d/physics/physicsquery/worldcastresult.md) returned from multiple queries.

```csharp
public void DrawQueryResult(PhysicsQuery.WorldCastResult result, Color color, float lifetime = 0, bool drawPoint = true, bool drawNormal = true)
```

### Parameters

**** (\[WorldCastResult]\(/engine/6000.5/script-reference/unity/u2d/physics/physicsquery/worldcastresult)): The result to use.**** (\[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 point in the result or not.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Whether to draw the normal in the result or not.

## DrawQueryResult(ReadOnlySpan\<WorldCastResult>, Color, float, bool, bool)

Draw the [PhysicsQuery.WorldCastResult](/engine/6000.5/script-reference/unity/u2d/physics/physicsquery/worldcastresult.md) returned from multiple queries.

```csharp
public void DrawQueryResult(ReadOnlySpan<PhysicsQuery.WorldCastResult> results, Color color, float lifetime = 0, bool drawPoint = true, bool drawNormal = true)
```

### Parameters

**** (\[ReadOnlySpan\<WorldCastResult>]\(https\://learn.microsoft.com/dotnet/api/system.readonlyspan-1)): The results to use.**** (\[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 point in the result or not.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Whether to draw the normal in the result or not.
