I’ve been trying to work on a turret script. And this basically involves finding the closest player, then getting the looks/up/right vectors of a CFrame created from the position of turret to the position of player. Then applying the rotation on the position of a weld.
The problem is that, the turret doesnt move the same way on the client and the server.
I dont recommend updating frames every milisecond/renderstepped/etc on the server unless its really neccessary since it can cause jitter/issues.
What you should be doing instead is handling the movement on the client, and replicate any important things like shooting on the server and verifcation/sanity checks.
First, please give people chances to reply, spamming this thread with multiple replies for help won’t get help faster.
Second, have you tried setting it on the client? If you have, are you still setting the CFrame of the model on the client? If you are, it would be messing up the math on the server. I would also try and move your code to the client to make it smoother and have less network usage.
Just tried it, and now I think I could make the problem more specific.
The welds replicate. However, they dont show up the same on the client and server because of differences in the way they handle the CFrame.
I have no idea on what these differences are, could anyone explain? Should they exist?
if there’s a “difference” in how the server and client handle CFrames, why wouldn’t you use a client sided script? And why is a weld needed? Wouldn’t anchoring the parts and just not having the weld work? You can use weldConstraints to keep the model together, and set the part that should be the rotation point of the cannon’s CFrame to what you’re currently doing.