# Areas of interest

### LiveQuery

The way you get information about the world is through **LiveQueries**. We set criteria for what part of the world we are interested in at each given moment. That way, the replicator won’t send information about everything that is going on in the game world everywhere, at all times.

Instead, we will just get information about what’s within a certain area, kind of like moving a torch around to look in a dark cave.

{% hint style="info" %}
More complex area of interest types are coming in future versions of coherence.
{% endhint %}

### Adding a LiveQuery to the scene

![](/files/-MdvHsmYsmIeIt2HgUxr)

A LiveQuery is a cube that defined the area of interested in a particular part of the world. It is defined by its **position** and its **radius** (half the side of the cube). There can be multiple LiveQueries in a single scene.

<div align="left"><img src="/files/-MYgZAVLgAjufnD3_QdJ" alt=""></div>

### Moving a LiveQuery

A classic approach is to put a LiveQuery on the camera and set the radius to correspond to the far clipping plane or visibility distance.&#x20;

Moving the GameObject containing the LiveQuery will also notify the replication server that the query for that particular game client has moved.

### Adding a TagQuery

In addition to the LiveQuery, coherence also supports filtering objects by tag. This is useful when you have some special objects that should always be visible regardless of world position.&#x20;

To create a TagQuery, right click a GameObject in the scene and select coherence -> TagQuery from the context menu.&#x20;

![](/files/NsDULxPLEVGdso1HztKF)

All networked GameObjects with matching tags will now be visible to the client. The coherence tag can be any string and can be configured separately from the Unity tag in the Advanced Settings section of the CoherenceSync component.

![](/files/9GUaZ4DFJ0cVxVvNCm67)

Tags and TagQueries can be updated at any time while the application is running, either from the Unity inspector or setting `CoherenceSync.tag` and `CoherenceTagQuery.tag` with code.

Currently, only a single tag per GameObject and TagQuery is supported. To include objects with different tags, you can create multiple TagQuery objects for each tag.

{% hint style="info" %}
In the future we plan to integrate TagQueries with LiveQueries allowing combined query restrictions, e.g., only show objects with tag "red" within a radius of 50.
{% endhint %}


---

# 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://docs.coherence.io/0.7.4/optimization/livequery-area-of-interest.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.
