Hey, I am wondering how to properly use NetworkTransformVisualizer. The docs are currently lacking on this component. When I just add a NetworkTransformVisualizer component to a networked game object with a NetworkTransform (SyncTransform mode) and set up a visualizer prefab, the prefab is always spawned at (0,0,0) and does not change at all. Any help is much appreciated.
I've only had luck making it work in "Transform" sync mode, not rigidbody. Try popping it over to that and see if it does the trick for you.
the NetworkTransformVisualizer only moves if the object it is attached to is not the authority. For the authoritative object (such as the local player on the host) there is no interpolation to show..
Hmm, the visualizer still does not move properly, even on a client. I do not know if this makes a difference, but I use the NetworkTransform on an NPC character. The NPC movement is controlled on the server by NavMeshAgent and I want the movement to be smoothly interpolated on the clients. The setup of NetworkTransform is as shown in the attached screenshot.
You need to be using Rigidbody sync to get interpolation. @seanr I got this for NPC objects on host as well. I had them on AI bots and NTV would stay at 0,0,0 when running on the host but worked ask expected on clients.
OK, when I switch to Sync Rigidbody 3D, at least the visualizer works properly. Unfortunately, however, the network transform itself does not work any longer. There is no smooth movement on the client any more. Instead, on the client, the NPC just snaps through the level so it seems that it is exclusively moved by the snap threshold. What's going on here? And why does interpolation do not work for SyncTransform as well?
Make sure IsKinematic is not checked on your rigidbody. Also that you don't apply changes to movement outside of FixedUpdate and only update on the server.
Thanks for your advice. But is this solution still compatible with moving the NPCs by NavMeshAgent pathfinding? I will try ofc.