I searched through a few example projects but I couldnt find what I am searching for. Maybe I just need the proper pointer.
Currently I am developing a turn-based board game. The GUI is the same for every player, except every player will see HIS stats on the right and the other players’ stats on the top. But how do I accomplish that?
I figured I need NetworkIdentities which I already added to my players but I have no idea how to implement what I want to.
Every player sees the blue area with his stats, the enemies will only be visible within the small red area which lacks some information and the green area is synchronized between all players. Any help/pointers/examples are greatly appreciated
I know this Q prolly screams like “RTFM” but I did and somehow I did not understand how to do it properly. So a pointer to a good tutorial or just the right paragraph in the manual could help. btw using Unity 5.4.2f2
Also: If [SyncVar] can not contain complex objects, then what do I need to do instead? I highly doubt one has to refactor all his code to break everything into structs but rather that SyncVar is a shortcut IF you have specific, individual variables that have a base type. Right? So the intention is never to use SyncVar for tasks like this.
I have a TileManager that has a 2D array of Tile. Tile is a complex object containing other complex objects and is also used as a prefab with connection to objects already set in the scene. So this makes the SyncVar way impossible in my understanding.
NullReferenceException: Object reference not set to an instance of an object
at ActivePlrHelper+c__Iterator6.MoveNext () [0x00000] in :0
at UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) [0x00000] in :0
The number of errors is exactly the number of objects that I spawned.