> For the complete documentation index, see [llms.txt](https://handtracking.lightbuzz.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://handtracking.lightbuzz.com/ui-reference/handvisual.md).

# HandVisual

Visualizes finger joints using LineRenderer.

```csharp
public class HandVisual : MonoBehaviour
```

Inherits [UnityEngine.MonoBehaviour](https://docs.unity3d.com/ScriptReference/MonoBehaviour.html) class.

### Constructors

| Name         | Description                      |
| ------------ | -------------------------------- |
| HandVisual() | Creates a new HandVisual object. |

### Properties

| Name   | Type                                                                         | Description                               |
| ------ | ---------------------------------------------------------------------------- | ----------------------------------------- |
| Hand   | [Hand](/api-reference/hand.md)                                               | The hand associated with the visual.      |
| Offset | [UnityEngine.Vector3](https://docs.unity3d.com/ScriptReference/Vector3.html) | The offset associated with the visual.    |
| Is2D   | bool                                                                         | Whether it shows the 2D or 3D positions.  |
| Image  | [ImageView](/ui-reference/imageview.md)                                      | The ImageView associated with the visual. |

### Methods

| Name                                                                                                              | Return Type | Description                                                                                                                                                                                            |
| ----------------------------------------------------------------------------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Load([Hand](/api-reference/hand.md),[UnityEngine.Vector3](https://docs.unity3d.com/ScriptReference/Vector3.html)) | void        | Visualizes the hand using `LineRenderer` objects. If an optional offset parameter is provided, it relocates the hand's position in 3D by the specified offset value. The offset is measured in meters. |
| Toggle(bool)                                                                                                      | void        | Sets `LineRenderer` objects to visible when set to `true`.                                                                                                                                             |

### Example

The example shows how to visualize a detected hand with the `HandVisual` class.

To visualize a hand, first, you need to instantiate a `GameObject` and get the component `HandVisual`. Then load the detected `Hand` to the specified `ImageView.`

```csharp
// Assign the prefab in the Editor.
[SerializeField] private GameObject _handPrefab;

// Instatiate GameObject.
GameObject handObject = Instantiate(_handPrefab, transform);

// Get HandVisual component.
HandVisual handVisual = handObject.GetComponent<HandVisual>();

// Visualize hand.
handVisual.Load(hand);
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://handtracking.lightbuzz.com/ui-reference/handvisual.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
