I need quick help, i'm doing a simple click teleporter and for some reason, when it changes the humanoidRootPart position in the script, the body breaks (rig)

local Remote = game.ReplicatedStorage:WaitForChild("RemoteEvents").FS
local D2Cordinates = script.Parent.Parent:WaitForChild("D2Cordinates")

db = false

script.Parent.CD.MouseClick:Connect(function(plr)
    local Character = workspace:FindFirstChild(plr.Name)
	if db == false then
		db = true
		Character.HumanoidRootPart.Anchored = true
		Character.HumanoidRootPart.Position = D2Cordinates.Position
		Remote:FireClient(plr)
		wait(1.5)
		db = false
	end
end)

Any help is appreciated

2 comments

0

Use CFrame instead, so replace Position with CFrame, and change line 7 to plr.Character instead.

0

Okay, thank you, that solved.