# CoherenceTagQuery

In addition to filtering object by distance using a [LiveQuery](/1.6/manual/components/coherence-live-query.md), coherence also supports **filtering objects by tag** with **CoherenceLiveQuery**. This is useful when you have some special objects that should always be visible regardless of their position.

{% hint style="info" %}
The tag used by the **CoherenceTagQuery** component is **not** based on [Unity's tag system](https://docs.unity3d.com/Manual/Tags.html).
{% endhint %}

{% hint style="warning" %}
Having **at least one query** in the scene **is necessary** to receive any network update!
{% endhint %}

## Using TagQueries

To create a TagQuery, right click a GameObject in the scene and select *coherence > TagQuery* from the context menu.

<figure><img src="/files/VG4qcluDxBJxPUdRcOoV" alt=""><figcaption><p>CoherenceTagQuery component</p></figcaption></figure>

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

![](/files/cGKJ2K7omBpglMt2PmQx)

Tags and TagQueries can be updated at any time while the application is running, either from the Unity inspector or setting `CoherenceSync.coherenceTag` and `CoherenceTagQuery.coherenceTag` in 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 an extent of 50.
{% endhint %}

### Limits

The Replication Server imposes limits on number of queries a Client can create. Read more about it in the [Replication Server](/1.6/manual/replication-server.md#maximum-query-count-per-client) section.


---

# 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/1.6/manual/components/coherence-tag-query.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.
