Hi everyone , I been working with Unet for a couple of weeks now and facing a issue of lag when playing game on WLAN , i connect using networkdiscovery once game starts , other players start lagging on my screen ( they will teleport , stutter etc ) its random , will happen for few seconds > stop > happen again ? . So far i have tried everything without any luck . Here are somethings i tried . I am using unity networktransform : Network Sendrate - 9 syncing rigidbody 3d movment threshold - 0.001 snap threshold - 5 interpolate movement - 0.5 rotation rotation axis - y ( topdown 2d ) interpolate rotation - 10 rest default I tried the above settings and faced lag in game so i ramped the sendrate to 29 , and same problem !!!! like increasing sendrate did nothing . Then i tried making custom network transform by simply doing the following : Code (CSharp): using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Networking; public class networkMovement : NetworkBehaviour { [SyncVar] Vector3 realPosition = Vector3.zero; [SyncVar] Quaternion realRotation; private float updateInterval; void Start() { } void Update () { if (isLocalPlayer) { //code... realPosition = transform.position; realRotation = transform.rotation; CmdSync(transform.position, transform.rotation); } else { transform.position = Vector3.Lerp(transform.position, realPosition, .1f); transform.rotation = Quaternion.Lerp(transform.rotation, realRotation, .1f); } } [Command] void CmdSync(Vector3 position, Quaternion rotation) { realPosition = position; realRotation = rotation; } } But still no luck . So i finally decided to post it here in hopes of finding the solution here . Any help is appreciated .
You might want to try and see if the recently released beta with the new networking code helps your situation; the send buffer can get saturated and no messages go through. Link to the post with the networking beta is below. https://forum.unity3d.com/threads/new-multiplayer-transport-release.435133/
Hi , ty for pointing that out , but apparently its not working for me . Cant figure out whats causing the lag , all i am syncing is via component network transform with interpolation on :x still the movement of objects get jittery and rough
Did you try setting SendDelay to a smaller value than the default 10.0f in the network configuration?