Ad
Log in to vote
0

Is this right way to make player teleport?

Asked by 5 days ago
script.Parent.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") then
        hit.Parent:MoveTo(script.Parent.Parent.Part.Position)
    end
end)

I have seen people use HumanoidRootPart and CFrame for teleport but is there anything wrong with making player teleport this way? it seems to work tho.

1
There's nothing wrong using MoveTo with teleportation, so yes it's completely fine. SEAN_YT213 104 — 5d
0
Thanks Sabailuridze 111 — 5d

2 answers

Log in to vote
0
Answered by 5 days ago

You can use PivotTo.

character:PivotTo(part.CFrame)
Ad
Log in to vote
-1
Answered by 5 days ago
Edited 5 days ago

Personally, I would use CFrame. (I haven't tested this tho)

local part = game.Workspace.Part -- Change This

script.Parent.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") then
        hit.Parent.HumanoidRootPart.CFrame = part.CFrame
    end
end)

Answer this question