# Sandbox.Terrain.RayIntersects

## Overload 1

```csharp
bool RayIntersects(Ray ray, float distance, out Vector3 position)
```

Given a world ray, finds out the LOCAL position it intersects with this terrain.

### Parameters

- `ray` (`Ray`)
- `distance` (`float`)
- `out position` (`Vector3`)

### Returns

`bool`

## Overload 2

```csharp
bool RayIntersects(Ray ray, float distance, out Vector3 position, out Vector3 normal)
```

Given a world ray, finds out the LOCAL position it intersects with this terrain.

### Parameters

- `ray` (`Ray`)
- `distance` (`float`)
- `out position` (`Vector3`)
- `out normal` (`Vector3`)

### Returns

`bool`

Declared in [Sandbox.Terrain](/api/Sandbox.Terrain).
Assembly: `Sandbox.Engine`.
