> For the complete documentation index, see [llms.txt](https://earnest-robot.gitbook.io/auto-hand-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://earnest-robot.gitbook.io/auto-hand-docs/auto-hand/hand/grabbable-highlighter.md).

# Grabbable Highlighter

## Hand Grabbable Highlighter

The `HandGrabbableHighlighter` class manages the highlighting of grabbable objects within reach of a hand in Unity. It periodically updates the highlighted object based on the hand's position and orientation.

<figure><img src="https://2959669391-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5zKO0EvOjzUDeT2aiFk3%2Fuploads%2FSOWbgFLlQc88FT0hBaZn%2Fimage.png?alt=media&amp;token=9a7c6787-d48d-4931-aa6c-9c2e8f8a1433" alt=""><figcaption></figcaption></figure>

### Public Variables

* `Palm Forward Right Direction` : When choosing between multiple targets to highlight, the hand will favor objects in the palm's local forward direction (0) or the palm's local right direction (1), or a blend between the two (recommended 0.5-0.75).

### Public Methods

#### GetHighlightHit

```csharp
csharpCopy codepublic RaycastHit GetHighlightHit()
```

Returns the closest raycast hit from the hand's highlighting system. If no highlight is present, returns a blank raycasthit.

**Returns:**

* `RaycastHit`: The closest raycast hit.

#### HandClosestHit

```csharp
csharpCopy codepublic virtual Vector3 HandClosestHit(out RaycastHit closestHit, out IGrabbableEvents grabbable, float dist, int layerMask, Grabbable target = null)
```

Finds the closest raycast hit from a cone of rays and returns the average direction of all hits.

**Parameters:**

* `closestHit`: Outputs the closest raycast hit.
* `grabbable`: Outputs the closest grabbable object.
* `dist`: The distance to check for hits.
* `layerMask`: The layer mask to use for raycasting.
* `target`: An optional target grabbable object to check for.

**Returns:**

* `Vector3`: The average direction of all hits.
