Player location missaligned between client and server

so i was working on a character selection system and i noitced a weird issue when i teleport the player’s selected character to a location the client and the server have the player’s visiual location in different places

the client has the correct position and visiual but the server has the HumanoidRootPart in the correct location but the rest of the character in the original place the character was standing before it got teleported

here’s a video example (right is server and left is client)


i tested with two clients and both clients had each other’s correct positions while the server got them both wrong still

here’s the code i use to switch the player’s character from the original to the chosen character and also teleport them

    local anim = plr.Character.Animate:Clone()
	local hp = plr.Character.Health:Clone()
	local Animator = Instance.new("Animator")

	-- switching the character which will delete the old one
	plr.Character = Bodies.Nemo
	plr.Character.HumanoidRootPart.Anchored = false

	-- parenting the copied scripts to the new rig
	hp.Parent = plr.Character
	anim.Parent = plr.Character
	Animator.Parent = plr.Character.Humanoid

	-- Teleporting Character and walking out of the bus
	plr.Character.HumanoidRootPart.Position = workspace.pointA.Position + Vector3.new(0,4,0)
	wait()
	plr.Character.Humanoid:MoveTo(workspace.PointB.Position)

I would recommend just using the :PivotTo() method for the character model. Setting the position of only the humanoid root part might have some unintended consequences. I imagine there is some sort of Motor6D problem going on here, which is offsetting the rest of the character from the root part. That’s just my guess.

1 Like

don’t set the Position directly, set the CFrame instead

thank you both!
i tried setting CFrame instead of position and it did work indeed and i tried doing it via :PivotTo() and it also works and makes the code look cleaner as well.