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

# HandTrackingModule

The `HandTrackingModule` class enables hand tracking.

## Example

```
//==============================================================================
// The following example demonstrates how to bind the position of a plane to a
// hand.
//
// Project setup:
// - Insert a plane
//==============================================================================

// Load in the required modules
const HandTracking = require('HandTracking');
const Scene = require('Scene');

// Locate the plane and focal distance in the Scene
const plane = Scene.root.find('plane0');
const focalDistance = Scene.root.find('Focal Distance');

// Store a reference to a detected hand
const hand = HandTracking.hand(0);

// Store the z-axis position signal of the focal distance
const focalDistanceZPosition = focalDistance.transform.z;

// Bind the cameraTransform of the hand to the plane's transform
plane.transform = hand.cameraTransform;

// Additionally overwrite the z-axis values with distance taken into account
plane.transform.z = hand.cameraTransform.z.sub(focalDistanceZPosition);

// Bind the hidden property of the plane to a boolean signal that returns true
// when no hands have been detected
plane.hidden = HandTracking.count.eq(0);
```

## Properties

| Property | Description                                                                                                                                              |
| -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `count`  | <p><code>(get) count: ScalarSignal (set) (Not Available)</code></p><p>Specifies a <code>ScalarSignal</code> indicating the number of detected hands.</p> |

## Methods

| Method | Description                                                                                           |
| ------ | ----------------------------------------------------------------------------------------------------- |
| `hand` | <p><code>hand(index: Number): Hand</code></p><p>Returns the <code>Hand</code> indicated by index.</p> |

## Classes

| Class                                                                                           | Description                                            |
| ----------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
| [`Hand`](https://sparkar.facebook.com/docs/ar-studio/reference/classes/handtrackingmodule.hand) | The `Hand` class describes a hand detected in a scene. |


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://sparkar-community.gitbook.io/docs/handtrackingmodule.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
