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 .
The Multiplayer/Networking sub-forum is a better place for this. It's scripting, so it isn't against the rules or anything, but you're a lot more likely to get help there. Also, be sure to paste code into the Insert->Code window or directly copy/paste from the script into tags. When you post it without tags it drops the whitespace/tabs, so even if you edit and add the tags properly it's still really annoying to read. When that happens, you need to re-copy from the original script.
Ty for telling me , reposted it under the proper section : https://forum.unity3d.com/threads/unet-wlan-lag.436980/ .