Having some troubles with syncing UI over all clients.
So I have a game with multiple players, each players has UI assigned to them. When they die, I update the UI (lives etc) but the UI only updates on the host, the clients UI doesn’t update.
My canvas has a network identity component with local player authority checked.
Noob4Sale was correct, you’re thinking about your multiplayer code wrong. “Commands” are called BY player objects and run ON the server (so you are getting the results you expect); “RPC” calls are called BY the server and run ON clients (which sounds closer to what you want, but then the host wouldn’t see the ui updates either).
You could do a combination, where first the Command executes on the server and then RPC calls are made to each client to keep them in sync;
or you could locally update each client before the command is sent;
or you could use SyncVars and add a networkID to each of the UIs;
there’s a bunch of ways to accomplish what you’re trying to do, but the way you are doing it now is giving unsurprising results.
Sorry to whine on your random thread but i need to vent. why the hell is so much hoop jumping needed to accomplish this. It’s called a high level api but it’s it’s frustrating to use and poorly documented. why can’t i just have object be in sync across the network period with sync var and all that stupid bul. 80% of networked game will need a shared ui
It’s not Unity’s fault you don’t understand how it works. Unity can only do so much, and the user has to fill in the rest of it. Especially for something you can use for free and make money off of. But unless you didn’t know, you can use SyncVars to just automatically keep values updated across clients, and to keep server authority SyncVars can only be changed on the server in order for them to be properly propagated across the clients.