In my room script, the host has race settings, and players who connect should see them (much like in Among Us), but the _raceLaps variable is not synchronized, and when I apply the SyncVar attribute to it, I get an error, since it is not a NetworkBehavior class. How can I sync it?
#One variable needs to be synchronized
4 messages · Page 1 of 1 (latest)
A) have NetworkMessages to update this values.
B) Have local variable just display "pendingPlayers" list count.
https://mirror-networking.gitbook.io/docs/manual/components/network-room-manager
C) make use of virtual functions on client side like :
OnRoomClientEnter()
OnRoomClientExit()
OnRoomClientConnect() and etc
I sent messages and now the variable is synchronized, but for some reason when the NetworkServer.SendToReady() method is called, the RoomSlots list is reset. With what it can be connected?
Sorry I am not the best at room manager. But from what I understand is that when you finish with roommanager it then loads you game. So room manager is used just as stepping stone. Normally people just overrides OnServerConnect() to register new List of users, with their information like authetication or usernames and connection id for easy acces from other sources. You could do that was well. I am sure there is better method, but as I mentioned i did not work with room manager a lot.