Hello all,
Here’s my problem: I spawn a network object from a prefab, it has some network behaviours with network variables. Upon spawning the prefab I want to adjust values of the network variables for this particular instance that I just spawned.
I tried setting values before calling NetworkObject.Spawn() - this gives me a warning:
NetworkVariable is written to, but doesn’t know its NetworkBehaviour yet. Are you modifying a NetworkVariable before the NetworkObject is spawned?
Ok then, I decided to set the values of network variables after the NetworkObject.Spawn() call. This works, but on the clients (when the spawned object gets spawned there) I get a few frames of invalid values in my network variables. So the question - is there a way to adjust a network object upon spawning before syncing it to the clients?