This is my first time using mirror and im trying to implement a card game. My goal would be that a player could locally select a deck before joining a server and when it joins the Player object already has the deck.
I know it probably has to do something with sending a NetworkMessage so that OnServerAddPlayer could use the Message send by the client but i cannot figure it out.
Could anyone give me a simple example how to simple for example the [SyncVar]
public string deckName variable for my Player so that 2 different users just select a name and when they join the server each player will have their unique name
#Setting a player's data locally so that Player can spawn with those attributes
2 messages · Page 1 of 1 (latest)
You can add deck selection to a custom Network Authenticator and store the choice in conn.authenticationData on server and read that back in Player::OnStartServer using connectionToClient.authenticationData to set a SyncVar to be included in player spawn payload.