# RayHit

> Aego 0.12.5 · development; docs build `4a32b816933e02930662f6a443cb25abe6050d090c55e237cbff5c44ae9b25f8`. [Build manifest](/docs-build.json).

```
struct RayHit
```

RayHit is the result of a ray query. Hit is false when nothing was found; Node is the body, Collider the node of the shape that was hit.

## Collider

```
field Collider NodeRef
```

References the node containing the collider shape that was hit; it may be a child of the body returned in Node.

## Distance

```
field Distance float
```

Stores distance from the query origin to the hit in world units, not a normalised fraction of the query length.

## Hit

```
field Hit bool
```

Reports whether the query found a collider. Check this before using the other result fields; a miss returns an empty result.

## Node

```
field Node NodeRef
```

References the rigid-body node that owns the hit shape; Collider identifies the actual shape node.

## Normal

```
field Normal Vec2
```

Stores the surface normal at the hit point in world space when Hit is true.

## Point

```
field Point Vec2
```

Stores the hit position in world coordinates and world units when Hit is true.
