NetworkObject
It's one of the most important components of the VIROO Networking System. This component assigns a unique identifier to the GameObjects to which it's added. In network-synchronized environments, objects must be uniquely identified with the same ID across all clients. This ensures consistent interpretation of interactions on the same object by all clients.
This component is also responsible for storing the information that refers to who has authority over an object.
A NetworkObject acts for all the NetworkBehaviour that are at the same level as it, or those that are nested in GameObjects within it.

Tip
The NetworkObject component is only necessary if the object requires interaction, movement or any kind of synchronization.
| NetworkObject | |
|---|---|
| Field | Description |
| Object Id | The field that uniquely identifies this GameObject to all users. |
| Authority | This is a read-only field that indicates, if checked, that the local user has the authority over this GameObject. |
Note
GameObjects with nested NetworkObjects isn't allowed in VIROO. If a GameObject has this component, none of its children must have it.
Object Id
As stated, it's important that the ObjectId field is unique. This is generated using the Generate Object Id button.
If a GameObject is duplicated without generating a new ObjectId, both objects will share the same ID. This will trigger an error log in the console.

Authority
Authority is important in networked systems. In server-authoritative networking, the server controls object behavior. Clients must request changes through the server to alter objects.
In VIROO the authority system is a bit different as a client can request authority over an object and, from that moment, it can change its behaviour without restrictions.
Sometimes there are certain behaviours that only one client should perform, and it's in these cases where the authority can help decide who does it.
For example, a common problem is the simulation of the physics. Simulating physics locally on all clients can lead to inconsistencies. It's recommended that only one client simulates the physics and shares the information with the others to maintain consistency.
In VIROO the authority can be requested by code, the component NetworkAuthorityEnsurer manages the authority of the NetworkObject automatically. You can find more information about this component in the component documentation.