# ECS / DOTS support

At the moment of writing, **coherence**'s SDK for Unity is built to work with GameObjects and Prefabs. As such, networking ECS entities requires some work on the developer's side.

## Making coherence work with DOTS

To network ECS entities, the main task is to transfer data between a GameObject networked by coherence and a corresponding ECS entity, which holds the gameplay data used and transformed by ECS Systems that are in charge of simulating gameplay.

In essence, gameplay that happens in the ECS space results in data that is saved to specific ECS entities. A system is then in charge of transferring this data onto GameObjects. At this point, coherence is able to synchronize that data, as normal.

This work should be done by an ECS System written specifically for the task, which would operate as a bridge between the world of GameObjects/MonoBehaviours and the world of "pure" ECS.

<img src="/files/ELljLTv4sQqeJpL8QUU8" alt="" class="gitbook-drawing">

Because the involved GameObject and its scripts would use non-DOTS API, the ECS System in charge of the transfer needs to be run on the main Unity thread and can't use [Burst](https://docs.unity3d.com/Packages/com.unity.burst@1.8/manual/index.html). For this reason, large scale simulations using this method are not recommended.

{% hint style="info" %}
**ECS entity or network entity?**

In coherence's documentation, the term **network entity** (or even just **entity**) appears frequently. This is not to be confused with an entity in the ECS sense.

Outside of this page, whenever you see the word **entity**, it has to be regarded as an instance of a Prefab that has been networked using the `CoherenceSync` component – not as an ECS entity.
{% endhint %}

{% hint style="success" %}
We are exploring including native support for Unity's DOTS and its workflows. This page will be updated to reflect any development.
{% 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/support/ecs-dots-support.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.
