#Static instance become null while another client disconnected.

11 messages · Page 1 of 1 (latest)

remote pivot
#

Just set a static var in class, didn't set null in anywhere, assign at OnStartClient in NetworkBehaviour. when client connect to host, its all normal, but once a client disconnected. the static var will be null. that's odd.

polar cairn
remote pivot
remote pivot
polar cairn
polar cairn
# remote pivot OK,I try another way

Look at the Basic example that comes with Mirror. Same principal. Each player object has a component that feeds the shared scene UI. UI fragment is part of it, but SyncVar for Ready, char choice, etc. with hooks can feed that too.

remote pivot
# polar cairn Look at the Basic example that comes with Mirror. Same principal. Each player ob...

I want to decentralize the player information so that it can behave differently in different scenes. However, I generated a corresponding CustomRoomAnnouncer for each player in one scene, which seems like too much. Now I'm trying to generate one CustomRoomAnnouncer per scene, so that the player's data in that scene is managed by a singleton on that server, rather than having one singleton per player.
Yes, you are right, I should use more such like SyncVar SyncList SyncDictionary.

remote pivot