Table of Contents

Class CoherenceNode

Namespace
Coherence.Toolkit
Assembly
Coherence.Toolkit.dll

By default, coherence only supports direct parent-child parenting between two synced game objects. The CoherenceNode component can be used to lift this restriction and support placement into arbitrary deep hierarchies.

Place this component on a GameObject to be able to parent it to any child transform of another game object and have that information be synchronized. Please note that a client needs to have authority over the child to be able to set its parent!

Note that both objects (parent and child) need to use CoherenceSync. They also need to be two different prefabs.

public class CoherenceNode : MonoBehaviour
Inheritance
CoherenceNode

Examples

Given a Player prefab with CoherenceSync, e.g. Root -> Arm -> Hand: To place a Gun in the hand, add CoherenceNode to the Gun prefab and parent the Gun instance to the Hand.

Constructors

CoherenceNode()

public CoherenceNode()

Fields

path

A comma-separated string with indexes used to locate the child transform of another game object with CoherenceSync, that the game object with this CoherenceNode component should be parented to.

[Sync]
public string path

Field Value

string

Examples

If root is another game object with CoherenceSync,
"1,0" means to place this game object under the right-hand transform:
(*) root
    (0) left-arm
        (0) left-hand
    (1) right-arm
        (0) right-hand
            (HERE)

Remarks

Automatically selected for syncing.

pathDirtyCounter

Used to keep track of if the current value of path has been applied.

[Sync]
public int pathDirtyCounter

Field Value

int

Remarks

Automatically selected for syncing.