Hey, relatively new to unity and coherence, but I am currently setting up my game to be multiplayer. I have it setup where the player will be assigned a color with their material, but nobody else can see that color. How can I sync that across the network?
I don’t think there’s a way to directly sync a parameter on the material, but if they all use the same mat and you’re just changing the color value on it.
You’ll need to make a new public variable for ‘Color PlayerColor’ that is synced across the network. When you assign the color to the local player’s material, also set the ‘PlayerColor’.
You can then create a callback for when that value is synced: [OnValueSynced] Attribute | coherence Documentation
This callback will be fired whenever that value is changed, including on the remote copies of your player. In that callback, set the material’s colour.
if you’re looking to change the material completely, then you’ll need to amend the above to send the material name or identifier.
In terms of what you can sync, you can find the supported types here: