Im trying out UNet and i’ve been toying with a little 2D game using custom physics (= not RigidBodies) and i’ve gotten basic multiplayer to work, but movement is stuttering/lagging.
I have added NetworkIdentity and NetworkTransform components to my player prefab, and played around with movement threshold, interpolate movement and so on but nothing makes movement really smooth. I have also tried implementing my own interpolation between current position and target position with Vector3.Lerp() and it actually makes it smooth(er), but also makes movement incredibly slow.
This was how i tried with Lerp (with different lerpTime’s but same result):
transform.position = Vector2.Lerp(transform.position, newPosition, Time.deltaTime * lerpTime);
I have tried Google, but all examples i’ve found seem to use the deprecated NetworkView and i’d rather stay away from all deprecated components. Can anyone point me towards any good example or documentation i’d be very grateful.
Thanks!