# HandSkeletonService

<Badge tone="type">class · Singleton</Badge> <Badge>Unity component</Badge> <Badge>singleton</Badge>

```csharp
public sealed class HandSkeletonService : Singleton<HandSkeletonService>, IHandSkeletonService
```

**Namespace:** `AR51.Unity.SDK`

Streams this device's tracked hand joints — positions, rotations, and confidence — sourced from the active hands adapter. Drop it on a scene object (it's a Unity component and a singleton); call `StartStreaming()`, then consume `GetStream()` for per-frame two-hand info.

:::caution[Units]
Joint positions are **world-space meters**, transformed by `OverrideWorldToLocalMatrix` before output (identity by default — no transform).
:::

:::note[Prefer the hands adapters]
`GetStream()` yields `TwoHandsInfoResponse` / `HandInfoResponse`, which are **transport (proto) types**. Don't bind UI or gameplay to them directly — read joints through the documented [hands adapters](/docs/sdk-api/unity-api/classes/adapters), which expose the same data as idiomatic Unity types. See also [hand data](/docs/sdk-api/unity-api/classes/hand-data).
:::

## Properties

<div className="apiPropTable">

| Property | Type | Default | Description |
|---|---|---|---|
| **Streaming** | | | |
| `IsStreaming` | `bool` | `false` | `true` while the hand stream is live (get-only) |
| **Transform** | | | |
| `OverrideWorldToLocalMatrix` | [`Matrix4x4`](https://docs.unity3d.com/ScriptReference/Matrix4x4.html) | `identity` | applied to all hand joints before output |

</div>

## Method summary

**Instance**

| Method | Returns | |
|---|---|---|
| [`StartStreaming`](#startstreaming) | `void` | <Badge>Unity component</Badge> |
| [`StopStreaming`](#stopstreaming) | `void` | <Badge>Unity component</Badge> |
| [`GetStream`](#getstream) | `BlockingCollection<TwoHandsInfoResponse>` | <Badge>Unity component</Badge> |

→ Full descriptions in [Method details](#method-details) below.

## Method details

### StartStreaming

<ApiBody kind="method" tags="Unity component">

```csharp
public void StartStreaming();
```

Begins streaming this device's tracked hand joints from the active hands adapter. After this returns, `IsStreaming` is `true` and frames start flowing into the collection from [`GetStream()`](#getstream). Call once (e.g. on `Start`/`OnEnable`).

</ApiBody>

### StopStreaming

<ApiBody kind="method" tags="Unity component">

```csharp
public void StopStreaming();
```

Stops the hand stream and sets `IsStreaming` back to `false`. Call when you no longer need hand data (e.g. on `OnDisable`).

</ApiBody>

### GetStream

<ApiBody kind="method" tags="Unity component">

```csharp
public BlockingCollection<TwoHandsInfoResponse> GetStream();
```

The per-frame two-hand info stream. Consume it on a background thread (or drain it from a coroutine) — `BlockingCollection<T>` blocks the caller until an item is available. Each `TwoHandsInfoResponse` carries both hands' joints in **world-space meters**, already transformed by `OverrideWorldToLocalMatrix`.

⚠️ `TwoHandsInfoResponse` / `HandInfoResponse` are transport (proto) types. Read joints through the [hands adapters](/docs/sdk-api/unity-api/classes/adapters) rather than binding to these directly.

<Returns type="BlockingCollection<TwoHandsInfoResponse>" typeHref="/docs/sdk-api/unity-api/classes/adapters">the live two-hand frame stream</Returns>

<Example inferred>

```csharp
var hands = HandSkeletonService.Instance;
hands.StartStreaming();

// On a worker thread — GetStream() blocks until a frame is ready:
foreach (var frame in hands.GetStream().GetConsumingEnumerable())
{
    // Prefer the hands adapters over reading the transport type directly.
    // Joint positions are world-space meters.
}
```

</Example>

</ApiBody>

## See also

- [Hands adapters](/docs/sdk-api/unity-api/classes/adapters) — the documented, idiomatic way to read the streamed joints
- [Hand data](/docs/sdk-api/unity-api/classes/hand-data) — the hand/joint data model
- [`ServiceManager`](/docs/sdk-api/unity-api/classes/servicemanager) — connection and service entry point
- [Hands, controllers & boundary](/docs/sdk-api/unity-api/hands-controllers-boundary) — area overview
- [Class index](/docs/sdk-api/unity-api/classes) — all Unity SDK types
