[**SixL client API**](../../README.md)

***

[SixL client API](../../README.md) / [raycasting](../README.md) / RaycastResult

# Interface: RaycastResult

What a ray test hit.

## Example

```ts
const hit = await mp.raycasting.testPointToPoint(from, to);
if (hit) mp.console.logInfo(`hit at ${hit.position.x}`);
```

## Properties

### entity

> **entity**: `number` \| [`EntityMp`](../../entity/interfaces/EntityMp.md)

The entity hit: a player, ped, vehicle or object the client knows, else 0 (the ground, a building, a map prop).

#### Example

```ts
if (typeof hit.entity !== 'number') { }
```

***

### position

> **position**: [`Vector3`](../../common/interfaces/Vector3.md)

Where the ray hit, in metres.

#### Example

```ts
const where = hit.position;
```

***

### surfaceNormal

> **surfaceNormal**: [`Vector3`](../../common/interfaces/Vector3.md)

The direction the hit surface faces (a unit vector).

#### Example

```ts
const up = hit.surfaceNormal.z > 0.9;
```
