Character Client & Server CFrame not in-Sync

The White Line is the intended Path for where the Character should go, while Red is where the Character’s Position appears on the Server. (Pink part is the starting point)

image

Video of this happening:

External Media

The script is entirely Server-Sided, the Bezier Curve module is just an open sourced Module I found, I doubt it relates to the overall bug.

	local Character = Player.Character
	local Humanoid = Character.Humanoid
	local Animator : Animator = Humanoid.Animator
	
	local pos1 = Character.PrimaryPart.CFrame.Position
	local pos2 = HostileNPCs.IdleDummy.BasicDummy.PrimaryPart.CFrame.Position
	pos2 = Vector3.new(pos2.X, pos1.Y, pos2.Z)
	local pos3 = Vector3.new((pos1.X + pos2.X) / 2, (pos1.Y + pos2.Y) / 2, (pos1.Z + pos2.Z) / 2) + Vector3.new(0, 0, -30)

	local bezierCurve = module.new(pos1, pos3, pos2)
	local bezierProgress = 0

	for _, characterPart in Character:GetChildren() do
		if characterPart:IsA("BasePart") then
			characterPart.Massless = true
			characterPart.CanCollide = false
		end
	end
	
	Humanoid.AutoRotate = false
	Humanoid.PlatformStand = true
	Character.PrimaryPart.Anchored = true
	
	Character.PrimaryPart.Position = bezierCurve:Get(bezierProgress)
	Character.PrimaryPart.CFrame = CFrame.lookAt(Character.PrimaryPart.Position, bezierCurve:Get(bezierProgress + 0.05))

	for i = 0, 9, 1 do
		bezierProgress += 0.1
	
		Character.PrimaryPart.Position = bezierCurve:Get(bezierProgress)
		Character.PrimaryPart.CFrame = CFrame.lookAt(Character.PrimaryPart.Position, bezierCurve:Get(bezierProgress + 0.05))
		task.wait(.1)
	end
	
	for _, characterPart in Character:GetChildren() do
		if characterPart:IsA("BasePart") then
			characterPart.Massless = false
			characterPart.CanCollide = true
		end
	end
	
	Character.PrimaryPart.Anchored = false
	Humanoid.PlatformStand = false
	Humanoid.AutoRotate = true

I believe your issue is that ur using root.Position to change character position in some instances. Try switching it to CFrame

did you give the server network ownership of the character before moving it?
also it takes time for the client to replicate its position to the server so its always going to have a slight offset

I tried giving the Server network ownership over the character already, but it yielded the same results. And regarding the offset, this issue is very different from the offset as the Server never gets in sync / even close to the Character’s position on the Client