Mirror Networking: Spawn prefab on all clients, but change a variable before spawning

I have never used one of these sites before, but after a week of trying to understand this and failing I am desperate.

I want every “player network object” to spawn a single sprite that is visible to all players, but before these objects are spawned I want them to be coloured.

The original prefab is white.

Half of the players are assigned blue and half are assigned red. I want to each gameobject to be coloured the appropriate colour before it is spawned.

Just create a bool SyncVar on the object. False means blue, true means red. In Start on the same script set the sprite’s color based on the value of this bool.

1 Like