> For the complete documentation index, see [llms.txt](https://stage-precision.gitbook.io/grid/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://stage-precision.gitbook.io/grid/unity-integration/tracking/track-a-scene-object.md).

# Track a scene object

Use SPNet Tracked Transform to drive an existing Unity GameObject with tracking data from Grid Studio.

This example connects a **Movable** with Object ID `1` to a Unity cube. Start with the connection described in **Connect Grid Studio and Unity**.

{% content-ref url="/pages/Ja1auhvBW5GmFp7vcqtE" %}
[Connect Grid Studio and Unity](https://stage-precision.gitbook.io/grid/unity-integration/getting-started/connect-grid-studio-and-unity.md)
{% endcontent-ref %}

#### Send tracking data from Grid Studio

1. Add or select a **Tracker** in the **Project Tree**.
2. In **Maps**, add an **SPNet Map Output** and assign your SPNet sender.
3. Set the output type to **Movable**.
4. Set the outgoing object ID to `1`.

You can change the Tracker's position and orientation manually, or drive it from a tracking source using a Map Input.

<div align="left"><figure><img src="https://1380116828-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fc4nPw8BslCHXa7bL2mf8%2Fuploads%2FPSb3si8IX5ILEGecfm5p%2FGrid_Studio_3bCg7guOmB.gif?alt=media&amp;token=9e684bf6-4864-42a9-be70-8f179cd64e16" alt="" width="413"><figcaption></figcaption></figure></div>

#### Add tracking to the Unity object

1. Create a cube using **GameObject → 3D Object → Cube**, or select an existing scene object.
2. In the Inspector, choose **Add Component → SPNet → SPNet Tracked Transform**.
3. Set **Object Type** to **Movable**.
4. Set **Object ID** to `1`.

The component automatically assigns the scene's SPNet Receiver or creates one when needed. If your scene contains multiple Receivers, assign the intended one in the **Receiver** field.

Match both **Object Type** and **Object ID** to the Grid Studio output. Object IDs range from `0` to `999` and default to `1`.

<div align="left"><figure><img src="https://1380116828-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fc4nPw8BslCHXa7bL2mf8%2Fuploads%2F3e4cbE8m2rQ8InHCcioJ%2FPowerToys_l892VMowoY.gif?alt=media&amp;token=16537a97-fbc5-44cf-9b83-5aa44c64f13b" alt="" width="434"><figcaption></figcaption></figure></div>

With **Preview In Edit Mode** enabled on the Receiver, the cube follows the incoming position and rotation in the Editor. Tracking also runs in Play mode.

#### Transform options

| Setting               | Default | Effect                                                            |
| --------------------- | ------- | ----------------------------------------------------------------- |
| **Apply Rotation**    | On      | Applies the received orientation to the object.                   |
| **Apply Size**        | Off     | Applies the received size as the object's local scale.            |
| **World Coordinates** | Off     | When enabled, applies position and rotation in Unity world space. |

By default, received position and rotation are applied relative to the object's parent. You can place the tracked object under a parent GameObject to move or rotate the tracking setup within your Unity scene.

Size is always applied as local scale.

#### Use the received Movable size

Enable **Apply Size** to drive the cube's dimensions from the incoming Movable data.

To set this size manually in Grid Studio, use **Viewport Scale** in the Tracker's **Display settings**. A received size of `(1, 1, 1)` gives Unity's default cube a local scale of `(1, 1, 1)`.

For other models, the received scale multiplies the mesh's original dimensions.

#### Use other tracking types

The component also supports **Rigid Body**, **Tracked Point** and **Camera**. Select the type matching the outgoing SPNet data.
