NetworkIdentity

Every networked Entity needs to have a NetworkIdentity component to uniquely identify it across the network.

If an Entity does not have a NetworkIdentity component, then DOTSNET ignores it.

NetworkIdentity API

Property:

Description:

netId

Unique ID to identity this Entity over the network. The ID is the same on the server and on the client.

prefabId

The prefabId of the prefab that this NetworkEntity was based on.

connectionId

The connectionId if the entity is owned by a connection, like a player or a player’s pet.

Null if not owned by anyone (like a monster).

This is only known on the server.

owned

True if this NetworkEntity is owned by the client, like the player and the player’s pet.

This is only known on the client.

transformDirection

SERVER_TO_CLIENT to sync position & rotation from the server to all clients. CLIENT_TO_SERVER for client authoritative movement where the client syncs it to the server, and the server broadcasts it to all other clients.

Last updated