Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [Command]
- void Cmd_AssignLocalAuthority(GameObject obj)
- {
- print("shifting authority successfully");
- NetworkInstanceId nIns = obj.GetComponent<NetworkIdentity>().netId;
- GameObject client = NetworkServer.FindLocalObject(nIns);
- NetworkIdentity ni = client.GetComponent<NetworkIdentity>();
- ni.AssignClientAuthority(connectionToClient);
- }
- [Command]
- void Cmd_RemoveLocalAuthority(GameObject obj)
- {
- print("reverting authority successfully");
- NetworkInstanceId nIns = obj.GetComponent<NetworkIdentity>().netId;
- GameObject client = NetworkServer.FindLocalObject(nIns);
- NetworkIdentity ni = client.GetComponent<NetworkIdentity>();
- ni.RemoveClientAuthority(ni.clientAuthorityOwner);
- }
Add Comment
Please, Sign In to add comment