#Changing Player color

1 messages · Page 1 of 1 (latest)

thin obsidian
#

Can you tell if the network variable is getting set on the player?

swift stirrup
#

yes, network variable is set on the owning player for sure

#

Is there a way to print the network variable of other clients?

thin obsidian
#

Yea. It's just NetworkVariable.Value. now on spawn the OnValueChanged callback will not be called. You will just have to set the renderer to that current value

swift stirrup
#

When you're saying "on spawn the OnValueChanged callback will not baclled", do you refer that it will not be called on the spawn of the client or the host?

Everything is working fine in my case except for when the host changes the color before client connects. But after the client connects and client changes color, both client and host can see it.

#

I tried copy-pasting the renderer color assignment code into OnEnable, as well as Update with no luck. I'll try out a few more things

thin obsidian
#

For any late joining client. The network variable will be set correctly for any existing players but their OnValueChanged event would not be called when they spawn in on the new client

swift stirrup
thin obsidian
#

Putting renderer.matierial.color = networkvariable.value or whatever into OnNetworkSpawn should work