-
Notifications
You must be signed in to change notification settings - Fork 0
Network Authority
Network Authority is put in place, so that someone with malicious intent cannot edit a server GameObject, or another client's object.
The client/server that creates the GameObject over the network, owns it.
Since all the clients/host will run Start(), Awake(), Update(), FixedUpdate(), Etc. There are some methods that will help see if you have authority to edit it.
NetworkObject.IsOwner()
returns if you are the owner of an object.
NetTools.isServer
will let you know if you are the server.
NetTools.isClient
will let yu know if you are the client.
The Server has authority over all objects. However IsOwner() won't return true for it, but it can still edit it.
If your server is the client & host. NetTools.isServer and NetTools.isClient will both be true.