CoherenceTagQuery
In addition to filtering network entities by distance using a Live Query, coherence also supports filtering them by Tag with CoherenceTagQuery component. This is useful when you have some special entities that should always be visible regardless of their position.
Using Tag Queries
To create a Tag Query, right click the Hierarchy window and select coherence > Tag Query from the context menu.

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

Tags and Tag Queries 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.
Multiple tags can be combined in a single Tag Query or tag on the CoherenceSync object as multiple strings comma-delimted or delimited by "|". E.g.: "red|blue". This example will match either "red" or "blue" or both.
All tags are compared case insensitive and white space is trimmed.
Limits
The Replication Server imposes limits on number of queries a Client can create. Read more about it in the Replication Server section.
Last updated
Was this helpful?

