> 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/spnet-unity.md).

# SPNet Unity

Connect Grid Studio with Unity to use live tracking, point data, camera and lens settings, and custom values in your scenes.

SPNet for Unity brings data from Grid Studio directly into Unity GameObjects and components. Use it to move existing objects, drive a virtual camera, create objects at tracked positions, or control component parameters.

#### Choose your workflow

| Component                    | What it does                                                                                                                                                               |
| ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **SPNet Tracked Transform**  | Applies incoming position, rotation and optional size to an existing GameObject.                                                                                           |
| **SPNet Camera**             | Drives a physical camera using tracking, field of view, focus distance and aperture, with lens distortion, center shift and overscan.                                      |
| **SPNet Point Spawner**      | Creates a copy of a reference prefab or scene object for each received point ID and updates its transform. Supports optional point size, color and events for interaction. |
| **SPNet Particle Cloud**     | Displays incoming points through a Unity Particle System, with optional received size and color.                                                                           |
| **SPNet Generic Data**       | Connects a named value to a parameter on a component attached to the same GameObject.                                                                                      |
| **SPNet Generic Controller** | Connects multiple named values to parameters across different scene objects.                                                                                               |

#### Working in Unity

Create a ready-to-use SPNet object from **GameObject → SPNet**, or use the **SPNet** submenu in the Hierarchy's **+** or right-click menu.

<div align="left"><figure><img src="https://1380116828-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fc4nPw8BslCHXa7bL2mf8%2Fuploads%2FDIG8HmoeI9mvMj5t6r7A%2FPowerToys_8PovQ4JbiK.gif?alt=media&amp;token=3bff0c41-264d-4c1f-a7fb-6fbc8585c06c" alt="" width="415"><figcaption></figcaption></figure></div>

To add tracking or parameter control to an existing object, select it and open **Add Component → SPNet** in the Inspector. This menu contains **SPNet Tracked Transform**, **SPNet Tracked Camera** and **SPNet Generic Data**.

<div align="left"><figure><img src="https://1380116828-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fc4nPw8BslCHXa7bL2mf8%2Fuploads%2F2Dk6oGCLGKcQBER9ECrD%2FPowerToys_gvXwEufvEB.gif?alt=media&amp;token=05823ce3-f438-4730-a657-92e2bbc0a5df" alt="" width="352"><figcaption></figcaption></figure></div>

The **SPNet Receiver** manages the network connection and receives data over UDP using multicast or unicast. When you add an SPNet component that needs a Receiver, it automatically finds an existing one or creates one for you.

Match the **Object ID** or **Camera ID** to the outgoing ID configured in Grid Studio. Generic values are selected by their message name.

Tracking, cameras, particle clouds and Generic parameter bindings can update while you work in the Editor. The Point Spawner creates its instances in Play mode.
