I download the example multiplayer project and it is pretty cool… it works…
So for a learning exercise, I attempted to replace the little Lerpz dude with one of my characters. This generally went OK… I carefully assigned the same scripts to my model except for one thing I could not figure out:
I could not change the “Observed” setting in the “Network View” window to match that of the Lerpz character. I have been trying to figure out how the Lerpz guy is different from my character. I suppose it is written to the “Network View” via some other script but I can’t find the connection.
So right now, leaving the “Network View” to the ‘transform’ of my character results in the 2nd model sort of popping in and out of the multiplayer view (unlike that of Lerpz where there are always good views of both characters).
Thanks for any insight or experience with this Unity example code.
Even if you simply open the example multiplayer project, change the ‘observed’ in the Network View on the Lerpz character (by dragging the character onto the field)… you cannot change it back to the original condition that was set in the example.
The example script is not tracking the transform of the prefab in the network view script - it’s tracking the “Network Interpolated Transform” script. Drag your character prefab into the scene and then drag the title of this script in the Inspector window into the “Observed” field of the network view.
What this does is, instead of synching the transform of the prefab automatically, it instead tells Unity to use the “OnSerializeNetworkView” function to handle synching, and this chunk of code deals with interpolation.
edit: after doing this, you’ll need to update the prefab by dragging it back from the scene into your assets. No idea if you would’ve figured this out or already know it, but thought I should mention it!