I am currently developing a mmo using unity engine, i have wrote the server with the udp communication and i have wrote some client scripts to process the packets on recieve. however everything is working as expected, apart from 1 thing, wich is why im writing this.
i have spawning complete, however i am sending new location update packets every 200 miliseconds (providing the entity has moved) however on the client side wat is the best way to smoothly move the other players entities (not the controlled entity by the client)?
i have looked into using lerp and itween but both appear very jittery when it comes to actually moving the game object.
ok, basically i have a packet handler running wich will process recieved packets from the server, here is the movement function that processes the movement packet
This script is attached onto the targets Gameobject
class ObjectMovement:MonoBehaviour
{
Vector3 Destination = new Vector3(0, 0, 0);
Quaternion RotationDest = new Quaternion(0, 0, 0, 0);
Ultimation, I know you’re not using the built-in networking components, but if you look at the “NetworkInterpolatedTransform” script that comes with the Networking Example from the resources section, you can see an example of how they compensate for lag and smooth out movement by keeping a buffer of 20 previous positions. You could probably use it as inspiration and code something similar for your setup.
Unity Networking example doesn’t work as it seems to be written in old Unity versions? Have someone got the fixed version that’s capable with Unity 3.0 onwards…?