> 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/spatial-interactive-experiences/building-an-interactive-tracking-project/add-zones-and-interaction-logic.md).

# Add Zones and Interaction Logic

Once the point cloud and clustering behave reliably, spatial Zones can be used to turn activity in the tracked environment into logic inside Grid Studio.

Grid Studio provides two different Zone types:

* **Trigger Zone** — reacts directly to points in the point cloud.
* **Presence Zone** — reacts to tracked clusters and therefore requires a working clustering pipeline.

Both Zone types can be positioned directly inside the tracked environment and can generate Workflow Events when their occupied state changes.

***

## Choose the Right Zone Type

The main difference between the two Zone types is the data they evaluate.

### Trigger Zone

A **Trigger Zone** reacts directly to points inside its volume.

This makes it useful when the presence of point-cloud data itself is enough to trigger an interaction.

No clustering is required.

Typical applications can include:

* Simple spatial triggers
* Detection areas where object identity is not important
* Fast interaction based directly on point presence

### Presence Zone

A **Presence Zone** operates on the final tracked clusters.

This makes it useful when the interaction should be based on detected objects rather than individual point measurements.

A working clustering pipeline is required before a Presence Zone can become occupied.

Typical applications can include:

* People entering or leaving an area
* Occupancy logic
* Object-specific interaction
* Tracking which detected objects move through an area

{% hint style="info" %}
Use a **Trigger Zone** when point presence is sufficient.

Use a **Presence Zone** when the interaction should operate on tracked clusters.
{% endhint %}

***

## Add a Zone

Zones are regular Objects in the Project Tree and are assigned to a Point Cloud Volume through the hierarchy.

To add a Zone:

1. Right-click an empty area of the **Project Tree**, or click the **+** button.
2. Search for **Trigger Zone** or **Presence Zone**.
3. Add the required Zone to the project.
4. Drag the Zone onto the **Point Cloud Volume** so that it becomes a child.

<div align="left"><figure><img src="/files/tV0tTkAzdffhqgrIkyQ0" alt="" width="252"><figcaption></figcaption></figure></div>

The Zone now evaluates the data processed by that Point Cloud Volume.

***

## Choose the Zone Shape

Select the Zone in the Project Tree.

In the Inspector, open the tab named after the Zone type:

* **Trigger Zone**
* **Presence Zone**

Use **Type** to choose the Zone geometry:

* **Cube**
* **Sphere**

Choose the geometry that best matches the physical interaction area.

A Cube is often convenient for architectural areas such as:

* Floor sections
* Doorways
* Stage areas
* Rectangular interaction regions

A Sphere can be useful for radial or less directional interaction areas.

<figure><img src="/files/du6A5Gr7h9uSwFWuON2w" alt=""><figcaption></figcaption></figure>

***

## Position and Size the Zone

The Zone can be positioned and resized either through its parameters or directly in the Viewport.

For interactive setup, the Viewport gizmos and scale handles usually provide the fastest way to place the Zone relative to the tracked environment.

Place the Zone where the interaction should occur and size it so that the intended activity can enter the volume without unnecessarily covering surrounding areas.

As with the previous spatial setup steps, use the Viewport in **World** orientation when working relative to the project coordinate system.

{% hint style="warning" %}
While a transform gizmo is active, remember to hold **ALT** when navigating the Viewport to avoid accidentally moving the selected Zone.
{% endhint %}

***

## Configure the Occupancy Thresholds

Both Trigger Zones and Presence Zones use separate thresholds for entering and leaving the occupied state.

The values represent different things depending on the Zone type:

**Trigger Zone**

Thresholds operate on the number of point-cloud points inside the Zone.

**Presence Zone**

Thresholds operate on the number of clusters inside the Zone.

The two main parameters are:

* **Enter Threshold**
* **Exit Threshold**

### Enter Threshold

**Enter Threshold** defines how much activity must be present before the Zone becomes occupied.

For a Trigger Zone this means the required number of points.

For a Presence Zone this means the required number of clusters.

### Exit Threshold

**Exit Threshold** defines when the Zone returns to its empty state.

Using separate Enter and Exit thresholds makes it possible to prevent the Zone from rapidly switching between occupied and empty when the measured value is close to the activation boundary.

***

## Smooth the Trigger Behavior

Zones also provide **Smoothing** to control how quickly or aggressively the occupied state reacts to changes.

This behaves similarly to an attack characteristic: instead of responding immediately to every short fluctuation, the Zone can be made more stable before changing state.

A small amount of smoothing can be useful when:

* Point counts fluctuate around a threshold
* Cluster detection briefly changes
* Movement close to the edge of a Zone causes unstable triggering

Avoid adding more smoothing than necessary, as this also makes the interaction feel less immediate.

***

## Configure Advanced Timing

For more explicit timing control, enable **Advanced**.

The Advanced settings provide additional controls such as:

* **Min Enter Time**
* **Max Enter Time**
* **Cooldown**

These settings can be used when threshold and smoothing behavior alone are not sufficient.

<div align="left"><figure><img src="/files/UZgU5EpdRjpiOYA7sf1e" alt="" width="308"><figcaption></figcaption></figure></div>

### Enter Timing

The Enter timing parameters provide additional control over how long an activation condition is allowed or required to develop before the Zone triggers.

This can be useful when an interaction should require a more deliberate presence rather than reacting to very short activity.

### Cooldown

**Cooldown** prevents the Zone from being retriggered too frequently.

This can be particularly useful for interactions where repeated rapid triggering would otherwise start the same action several times.

{% hint style="info" %}
Start with the normal thresholds and Smoothing first.

Enable **Advanced** timing only when the interaction requires more explicit control over activation timing or repeated triggers.
{% endhint %}

***

## Use Zone Workflow Events

Zones can generate Workflow Events that allow spatial activity to directly drive logic elsewhere in the project.

<figure><img src="/files/d4qiGzJ4vzXrnWyqfXLL" alt=""><figcaption></figcaption></figure>

### Trigger Zone Events

A Trigger Zone provides:

* **Occupied**
* **Empty**

**Occupied** is triggered when the Zone enters its occupied state.

**Empty** is triggered when the Zone returns to its empty state.

### Presence Zone Events

A Presence Zone provides:

* **Occupied**
* **Empty**
* **Object Entered**
* **Object Left**

In addition to the overall Zone state, a Presence Zone can therefore react to individual tracked objects entering or leaving the area.

This makes Presence Zones particularly useful when the interaction needs to distinguish between:

**The area is occupied**

and

**A specific tracked object has entered or left the area**

***

## Build Interaction Logic

Zone Events can be used as triggers inside Workflows.

For example:

**Person enters Presence Zone → Object Entered → Workflow Event → Start interaction**

or:

**Point activity enters Trigger Zone → Occupied → Workflow Event → Activate content**

The Zone therefore forms the connection between the spatial tracking pipeline and the wider logic of the Grid Studio project.

***

## Tune the Zone Under Real Conditions

Test the Zone using the same kind of movement and interaction that will occur during operation.

For a Trigger Zone, observe how the point count behaves when:

* Someone enters the area
* Someone stands near its boundary
* Only a small part of an object enters
* Noise or unwanted measurements appear

For a Presence Zone, observe:

* Cluster entry and exit
* Multiple objects inside the Zone
* Temporary cluster loss
* Movement close to the Zone boundary

Adjust:

* Zone position and size
* Enter Threshold
* Exit Threshold
* Smoothing
* Advanced timing where required

until the interaction responds reliably without becoming unnecessarily sensitive.

***

## Trigger Zone or Presence Zone?

A simple rule can help when choosing between the two:

**Do I only need to know that spatial data is present?**

Use a **Trigger Zone**.

**Do I need to react to detected and tracked objects?**

Use a **Presence Zone**.

Both can be part of the same Point Cloud Volume and can be used for different interaction requirements within the project.

Once the internal interaction logic is working, the same tracking data can also be sent to external systems.

Continue with **Output Tracking Data**.
