My goal is simple: I want to anchor the player, and tween them to to the position of a part while they’re rotating randomly
This is run on a regular script, and client side, it works perfect, but when I look at the character on the server, the character completely does a twirl into the ground, and then goes to a completely separate position, as shown in the video below:
I’m completely blank as to what is causing it, although it doesn’t have anything to do with the character rotating. it seems like the server thinks the rootpart of the character is way off of where it should be, considering how it sort of orbits around the desired position, but I have no idea why that would be. It also does the same in R6.
Edit:
My idea of it being caused by the rootpart and the character having desynced position seems to be correct, although I still have no idea why this happens, let alone why it only happens on the server:
I would propose the omission of lines related to rotation so you may get a clearer picture of what is happening to the root part without visible orientation changes. Be sure to check the root’s connection to the torso. I will test this myself in a moment.
I think I might know what the problem is. It seems like on the server, it only moves the rootpart, rather than the entire character (duh), in the sense that I’m not using PrimaryPart:PivotTo, and just giving the root part a new position. I’m guessing the server and client handles this differently for some odd reason; the client making sure the rootpart and character welds are connected correctly, and the server doesn’t.
I’m guessing I can’t use a function such as PrimaryPart:PivotTo in a tween function, and have to instead run the tween on a Vector3 value, and update the position in a loop.
I had found that game.TweenService:Create(game.Workspace.Dummy.HumanoidRootPart, TweenInfo.new(6, Enum.EasingStyle.Linear, Enum.EasingDirection.In, 0, false, 0), {CFrame = game.Workspace.Part.CFrame}):Play() had provided a smooth transition without separation of the root and the body. I don’t quite like how this is handled, and I know there is some better way to change the CFrame. Rotation is in this case an issue, and may need to either be predicted or somehow eliminated as a factor in the tween’s execution. The way that CFrames work makes the latter option difficult, if what I had been trying to do a few minutes ago was any example of its drawbacks.
Note: doing the original configuration you had where the root was moved up on the CLIENT makes it look normal on the server, but not on the client. Observe:
Client view.
Server view.
Result when using server:
Client view.
Server view.
For the CFrame option, both client and server have the same result; i.e., a good one. The rotation is, of course, ruined by its execution.
Anchoring the torso and using the non-CFrame approach on the serverside causes the client to behave properly, but the server…
In Summary: Roblox’s physics delegation system and CFrame class makes this more confusing than it has to be. There is a workaround. I am completely aware that there is one, but I do not know how to reach it on this platform. If no-one recovers it today, I will get it eventually, because I need this behavior myself.