Hi,
I’m currently having some difficulty with a NetworkVariable that seems to never-endingly replicate. If I log data from the OnValueChanged delegate, it shows that both the previous and current values are identical. e.g. logging crudely with
Debug.Log("NetworkObject " + _Weapon.Vehicle.NetworkObjectId + ", Owner + " + _Weapon.OwnerClientId + ":_Weapon.Selected.OnValueChanged:" + prev + "," + next);
I find my console is flooded with messages like
which has the same value for both prev and next (separate question - why was OnValueChanged invoked if the value did not change?)
The amount of replication steadily increases, until NetworkEarlyUpdate takes long enough that the client completely freezes:
I must be doing something wrong, but I’ve been looking a while and haven’t made any progress. I do have something subscribed to OnValueChanged, and I wondered if having an exception in that callback would somehow cause replication to fail and for the server to try to send again (is that possible?). However, after disabling those callbacks I wasn’t able to find any clues.
Any thoughts would be greatly appreciated.
Cheers,
Elliot