Skip to content
Strée Eloi edited this page Jan 24, 2018 · 6 revisions

Network & Communication

To know

Doc: Manual Video Tutorial Text Tutorial Google

[SyncVar]
public int syncVar; //Change on server, change everywhere

[SyncVar (hook:"OnVarChange")]
public int syncVar; //Change on server, change everywhere
public void OnVarChange(int newVar){/Methode executed at any network change of the var/}

[ClientRpc]
public void RpcMethodeName(){/Excuted on client from server/}

[Command]
void CmdFire() {/Excuted on client from client/}

NetworkServer.Spawn(bullet); // Spawn a prefab defined for network at start

Clone this wiki locally