Since Netcode for GameObjects uses a server authoritative model, the server will always have read or write permissions to any NetworkVariable. As an example, if you set both the read and write permissions to Owner the server can still read and write to the NetworkVariable.
But still, when the server tries to set the variables value like:
MyNetworkedVar.Value = value;
It fails with the following exception: InvalidOperationException: Client is not allowed to write to this NetworkVariable
Am I missing something? I made sure that the code is executing in the server, and only in the server. Writing from the owner client works fine.
The documentation is incorrect, the server doesn’t have authority over network variables with client owner write permission. I’ve mentioned this previously and was told this is to avoid concurrency issues with server/host and client both changing the same value. Referring to the server as a ‘Client’ doesn’t make much sense though in a server-only scenario.
You can get around the problem by quick switching object ownership to the server but it’s probably not recommended.
Okay I see, I solved it by just making it owned by the server and having the client modify it through ServerRPCs, I guess I trusted the documentation blindly, thanks for the input!