hi ![]()
I’m currently working on making my game a multiplayer one, so far everything went great until i attached the network transform component to my player prefab, the rotation works awesome but the position of the players is updated(shown) after the player makes a long enough distance, it doesn’t update the position by time but every certain amount of distance (a few meters, not more, but it’s still not close to being smooth which is how i want it to be) made by the player does anyone know what i can do to fix it?
thanks alot! ![]()
A few things to look at:
- https://docs.unity3d.com/ScriptReference/Networking.NetworkTransform-interpolateMovement.html when you increase this value, the “smoothing” of the changes between network updates is quickened. So basically, lowering it will account for larger changes between updates
- https://docs.unity3d.com/ScriptReference/Networking.NetworkTransform-movementTheshold.html this states how much an object must move before a new update is sent about it’s position. By the sounds of things, this value is currently too high for you. I don’t recommend putting this lower than 0.1 though, as otherwise you could end up sending updates even when the object isn’t moving due to floating point precision.
- https://docs.unity3d.com/ScriptReference/Networking.NetworkTransform-snapThreshold.html this causes the object to move instantly to it’s updated position when an update comes in from the server, if it’s distance is more than this value. You should always set this value to be quite a bit higher than movementThreshold, otherwise movement will look glitchy
Have a look at the other properties too, listed here: https://docs.unity3d.com/ScriptReference/Networking.NetworkTransform.html. The “sync” related properties may also play a part in the issue that you are facing, although it’s a little less likely.
Hopefully this helps.