# Binding Values

The Binding System 2 was designed to help you link objects as quick and simple as possible. Most of the fields are bindable out of the box, in most of the scripts, objects, materials and components. If a field is serialized and its drawer includes a BeginProperty call, it can likely be bound. By default, all fields in scripts with standard drawers are bindable, meaning your scripts and third-party scripts using Unity-compliant drawers are fully compatible.

To bind a field, hover over the field and right click on it to reveal a property menu. In this menu, select *<mark style="color:blue;">Enable Binding</mark>*.&#x20;

<figure><img src="/files/ftvwGVBc9xhRAliC8Olh" alt="" width="375"><figcaption><p>Enable Binding for a field</p></figcaption></figure>

Once the bind control appears on left-hand side of the field, click on it to bound the field.

<figure><img src="/files/p4qINBtU7FVX1dgUh4aV" alt="" width="366"><figcaption><p>Bind Control on a field</p></figcaption></figure>

Once the field is bound, the data pipeline will be seen with some controls to set it up.

<figure><img src="/files/rHYE0GeImjkgmHDEb5TG" alt="" width="375"><figcaption><p>Bound Field</p></figcaption></figure>

This drawer makes it easy to configure bindings within the Inspector. Additionally, the BindingSystem is compatible with the Odin Inspector, a popular Unity extension.

To disable binding for a field, do the process above in reverse: first unbind the field, then right click on the field and select *<mark style="color:blue;">Disable Binding</mark>*.

{% hint style="success" %}
Binding fields is **non-destructive**, meaning the serialization logic of the field is left untouched and all bind related serialization data is serialized in a different place.&#x20;

This may not be the case when *Update in Edit Mode* is enabled, in this case the value will be updated and overwritten over its original data.
{% endhint %}

### Data Pipeline

Data Pipeline is handling the data through a set of stages, some of them optional, to deliver it to its destination. The direction of the pipeline depends on selected <mark style="color:orange;">BindMode</mark> value. When "reading" data, the data goes from bind source property to bound field, that is, from right to left. When "writing" on the other hand, the data goes from bound field towards bind source property. By default, the bind mode is set to <mark style="color:orange;">Read</mark>.

The stages are listed below in the image:

<figure><img src="/files/lFhSSCAvOhwgRddAhIek" alt=""><figcaption><p>Data Pipeline Read Mode Example</p></figcaption></figure>

### Smart Dropdown

The BindingSystem provides a custom-built searchable dropdown menu that simplifies the access and setup of each binding property.&#x20;

When clicking on path control or any other Bind option button, a custom dropdown, **Smart Dropdown**, will appear with relevant information or options to choose from. It can handle different types of data controls, such as checkboxes, input fields, buttons, groups, and more.&#x20;

<figure><img src="/files/KaEldTALsvw8KWW25U52" alt=""><figcaption><p>Default view of Smart Dropdown</p></figcaption></figure>

When selecting a bind path, the custom dropdown lets you select direct entries:

<figure><img src="/files/N3E8xpgIrhJAF8MPnryy" alt="" width="302"><figcaption><p>Direct Values</p></figcaption></figure>

Or compound entries when both the direct entry and its children are valid choices:

<figure><img src="/files/FGgZPc0g7t3YHQ5q0f46" alt="" width="289"><figcaption><p>Compound Values</p></figcaption></figure>

Or search a value among the ones present:

<figure><img src="/files/tmSC0rQUL69357YFOV8r" alt="" width="301"><figcaption><p>Search Values</p></figcaption></figure>

### Bindings Update Points

{% hint style="info" %}
Code based bound fields (with <mark style="color:orange;">`Bind<T>`</mark>) are refreshed in user-code and don't need automatic refreshes.
{% endhint %}

The system automatically refreshes bound fields to keep them always with the latest available data. The update logic is very fast but it still incurs a small overhead. To avoid wasting performance, the system allows to decide at which point a bound field should be refreshed. There are several predefined points that you can select:

<figure><img src="/files/8IiHYl4VRwJ6adunYC88" alt="" width="443"><figcaption><p>Update points</p></figcaption></figure>

Here are the update points:

* **Editor**: will refresh the bound fields during Editor frame update. Enable this point if you need to see the changes without going to Play mode.
* **Update**: will refresh the bound fields during Update phase at runtime. This is the default update point.
* **Late Update**: will refresh the bound fields during Late Update phase at runtime.
* **Render**: (Available from version 2.2.2) will refresh the bound fields just before rendering the frame. This is useful when refreshing fields linked to animations and IK calculations.
* **Fixed Update**: will refresh the bound fields during Physics update phase. Useful when dealing with fields linked to physical simulations.
* **On Change**: will refresh the bound fields in any of the previous points (except Render and Editor) and only if the source value has changed.

Since version 2.2.2 it is possible to manually refresh a bound field, through Unity Events. Simply select the bound field to update from the available options and it will refresh when the event is raised. This is useful when you want more control over when to refresh the bindings.&#x20;

When a bound field is selected in the event, a button will appear with the field. Clicking on it will open the bound field popup from where you can do adjustments. Control (or CMD on MacOS) + Clicking will highlight the bound field in the inspector.

<figure><img src="/files/5ipvFReN0itxXexwnb08" alt="" width="480"><figcaption></figcaption></figure>


---

# Agent Instructions: 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:

```
GET https://postica.gitbook.io/binding-system-2/product/binding-values.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
