I have a system where units are moved with LinearVelocity move to a given target (in my case where the mouse clicks) This works fine with basically no lag but when there is lag (200+ ping) the units over shoot shown here:
I have impletmented a system to slow them down when they close to the target but they dont slow down when there’s lag. Sometimes they can even over shoot in a way that they’ll just go around in loops like here:
Changing the units primary part to the player ownership didnt work. Note that i am changing the LinearVelocity on the server side so it replicates to other players
I am using a linearvelocity to move the unit so i dont like multiplying by deltatime will do much as roblox should do frame-independent frame calculations and I already tried setting the unit’s PrimaryPart’s (the LinearVelocity is in the PrimaryPart) network owner to the player but it didnt work, still over shoots
It works but before I can lerp the Position to the goal the units still over shoots before if happens creating a jarring teleporting effect which I want to avoid
All the moving is happening on server side (including the lerping i just added) the only client side thing is sending a position to the server of where i want the units to move to
You could also try setting the network owner as nil, which should prevent the server from automatically changing the network owner as the units move around.
If you explicitly set nil as the network owner then I believe the server will stop automatically transferring ownership to nearby clients, which might be the reason for the stutters.
That, or you can go the route where you set the units’ owner as the network owner, but then the server won’t be able to move them, the client will need to run the physics for their movement.