Physics desync issue, jittering and spazzing out

Hello, I made this worm boss creature with BallSocketConstraints and BodyVelocities in each part of the worm.

The issue I’m having is that the worm’s movements are smooth on the server side but on the client side, it’s moving weird and unpredictably and I was wondering if there is a way to fix this?

All I want is just for the client to see what the server is seeing.

Here’s a video example, left is server, right is client.

Thanks in advance,
Khronos

1 Like

This looks like it might have something to do with network ownership. Try setting network ownership of all the worm’s parts to the server. Something like this:

--wait for worm to be parented to workspace for :SetNetworkOwner() to work (if script is inside of worm then the wait will likely be done automatically) 

local worm = script.Parent 

for i,v in pairs(worm:GetDescendants()) do 
	
	if v:IsA("BasePart") then 
		
		v:SetNetworkOwner(nil) --setting to nil is the same as setting to server 
		
	end 
	
end 

Instead of setting to server, for overall better results, you can set the network owner to the client and control the worm on the client, but this wouldn’t be ideal unless the game were single-player or unless you don’t mind inconsistencies between clients.

Hope this is actually the problem, though. If not, I’ll be happy to look into it more.

2 Likes

The network ownership of the worm is already the server. Thanks for helping though, but I’ve manage to solve it.

I solved the problem by removing the BodyVelocity and BallSocketConstraints on the client side and it fixes it.

3 Likes