# Child CoherenceSyncs

### Overview

Objects with the `CoherenceSync` component can be connected to other objects with `CoherenceSync` components to form a parent-child relationship. For example, an object can be linked to a hand, a hand to an arm, and the arm to a spine.

{% hint style="info" %}
When an object has a parent in the network hierarchy, its transform (**position** and **orientation**) will update in **local space**, which means its transform is relative to the parent's transform.
{% endhint %}

{% hint style="warning" %}
A child object will only be visible in a LiveQuery if its parent is within the query's boundaries.
{% endhint %}

### Usage

Creating an Entity hierarchy is very simple. All you need to do is add a GameObject with a `CoherenceSync`component as a direct child of another GameObject with a `CoherenceSync`component. **You can add and remove parent-child relationships at runtime (even from the editor).**

Destruction or disconnection of the parent object will also destroy and remove all children of this object. Those objects' state needs to be treated on the Client side to be reinstantiated on the next connection.

### **Hierarchies with intermediary transforms**

Sometimes, it is not practical to add `CoherenceSync`objects to all the links in the chain. For example, if a weapon is parented to a hand controlled by an Animator, we do not need to synchronize the entire skeleton over the network. In that case, see [CoherenceNode](https://docs.coherence.io/1.0/coherence-sdk-for-unity/networking-state-changes/hierarchies-and-child-objects/coherencenode).

### Level of detail considerations

If the child object is using LODs, it will base its distance calculations on the world position of its parent. For more details, see the [Level of detail](https://docs.coherence.io/1.0/optimization/level-of-detail#using-lods-with-connected-entities) documentation.

### Handling parent destruction

When the parent `CoherenceSync` is destroyed, by default its `CoherenceSync` children get destroyed together with it. This can be changed via the *Preserve Children* option on the parent:\\

<figure><img src="https://352971571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOnNWMLfYsbCzCnIbNrcP%2Fuploads%2F4xoF8r5ql4PFtt24QBih%2Fimage%20(1)%20(4).png?alt=media" alt=""><figcaption></figcaption></figure>

When the *Preserve Children* option is enabled, destroying the parent entity will result in children getting unparented instead of being destroyed together with the parent. Those children will now reside at the root of the scene hierarchy.
