> 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/parameter-control/control-a-component-parameter.md).

# Control a component parameter

Use SPNet Generic Data to connect a named value from Grid Studio to a parameter on the same Unity GameObject.

#### Configure a generic message in Grid Studio

1. Drag your **SPNet Sender** from the **Project Tree** into a **Workflow** or **Modifier**.
2. Choose the send action for the needed parameter type.
3. Set or link the value.

<figure><img src="https://1380116828-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fc4nPw8BslCHXa7bL2mf8%2Fuploads%2FphTOrkarEzeoU7bSOWAR%2FdFga3pLQS9.gif?alt=media&amp;token=4ab933ed-6544-48ce-ad47-e0f45c41ea70" alt=""><figcaption></figcaption></figure>

{% content-ref url="/spaces/sBgAXldtujxgD0i1CUSI/pages/tsGCOYLBfnnJxrzUjDpF" %}
[Workflow vs Modifier](https://stage-precision.gitbook.io/grid/grid-studio-fundamentals/fundamentals/core-concepts/workflow-vs-modifier.md)
{% endcontent-ref %}

#### Connect a parameter in Unity

1. Select a object in your scene.

2. Choose **Add Component → SPNet → SPNet Generic Data**.<br>

   <div align="left"><figure><img src="https://1380116828-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fc4nPw8BslCHXa7bL2mf8%2Fuploads%2FcDYSCfdf6VZEq2Xfrolu%2FPowerToys_YEaEgnQ4bk.gif?alt=media&amp;token=b34c0cb8-11d1-489a-818a-e4d48460f527" alt="" width="458"><figcaption></figcaption></figure></div>

3. Set the **Generic Name** mathing the **Key** parameter value within an action or modifier node within Grid Studio.<br>

   <div align="left"><figure><img src="https://1380116828-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fc4nPw8BslCHXa7bL2mf8%2Fuploads%2FKoN6qfEfbRM9l1hq8ZGG%2Fimage.png?alt=media&amp;token=6ac3d1f4-d1e8-4348-8a2a-9b1a1bc2657a" alt=""><figcaption></figcaption></figure></div>

   <div align="left"><figure><img src="https://1380116828-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fc4nPw8BslCHXa7bL2mf8%2Fuploads%2FjINsD6TynKhaLbM055Yh%2Fimage.png?alt=media&amp;token=2bf04f2a-b890-4a64-9a55-92b132265e39" alt=""><figcaption></figcaption></figure></div>

4. Open **Target Parameter** and select the property you like to control.\
   For example to control the text of a Text Mesh component, choose **Text Mesh → Text (Text)**.<br>

   <div align="left"><figure><img src="https://1380116828-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fc4nPw8BslCHXa7bL2mf8%2Fuploads%2FeShxnxnfHHgoR3zSOqiC%2FPowerToys_s7zZMXnlC8.gif?alt=media&amp;token=45a85e48-59f5-4f88-8995-340ccfd0476b" alt="" width="314"><figcaption></figcaption></figure></div>

5. Trigger the action in Grid Studio to send the value.

The Receiver is assigned automatically or created when needed.

**Target Parameter** lists supported parameters on components attached to this GameObject. For a TextMeshPro object, choose the **Text** parameter under its text component.

<figure><img src="https://1380116828-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fc4nPw8BslCHXa7bL2mf8%2Fuploads%2Fxb1pn4wyvyO7u0Jehkaw%2FPowerToys_n7VP0xOdjD.gif?alt=media&amp;token=06fb7be9-09c9-4758-a2cc-9d29f14599b3" alt=""><figcaption></figcaption></figure>

#### Select a received value

{% hint style="warning" %}
**Generic Name** must match the outgoing name exactly, including capitalization.
{% endhint %}

Once a value has arrived, you can also select its name from **Received Names**. The Inspector shows its **Data Type** and **Current Value**.

<div align="left"><figure><img src="https://1380116828-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fc4nPw8BslCHXa7bL2mf8%2Fuploads%2F3Z4nZhUJ4rQNuciizarc%2F4goCK3Vnsx.gif?alt=media&amp;token=1b2c3094-3968-4ce9-98b8-75ee70af89b2" alt="" width="288"><figcaption></figcaption></figure></div>

When the received type is known, **Target Parameter** lists parameters compatible with that value.

Generic values remain available until the Receiver is reset, including when **Reconnect** is used.

#### Use other parameter types

Supported target parameters include **Integer**, **Float**, **Bool**, **Text**, **Vector2**, **Vector3** and **Color**.

For example, you can connect a Float to a Light's intensity, a Color to its color, or a Vector3 to a Transform's local position.

For Bool parameters, numeric `0` becomes false and other finite numeric values become true. Vector2 parameters use the X and Y components of a received vector.

#### Update in the Editor

With **Preview In Edit Mode** enabled on the Receiver, the target parameter updates directly in the Editor. Changes made in Edit Mode can be saved with the scene.

The same binding also works in Play mode.

#### Value events

Expand **Value Events** to connect callbacks for custom behaviour.

Choose a function from the event's dynamic section to pass the received value to it. For callbacks that should also run in Edit Mode, use **Editor And Runtime** on the listener.

To route several named values to different scene objects, continue with **Control multiple objects**.
