There are many ways like using a Body Position(false teleporting), or Torso Positioning with CFrame. But what is the best way to teleport which causes the least bugs.
Example one: This uses CFrame
local debounce = true
local Tele2 = game.workspace.ExampleVariablePart
script.Parent.Touched:connect(function(hit)
if debounce == true and hit.Parent:FindFirstChild("Humanoid") then
debounce = false
hit.Parent.Torso.CFrame = Tele2.CFrame
wait(1)
debounce = true
end
end)
Example two: This uses a bodyposition
local debounce = true
script.Parent.Touched:connect(function(hit)
if debounce == true and hit.Parent:FindFirstChild("Humanoid") then
debounce = false
local BP = Instance.new("BodyPosition")
BP.Parent = hit.Parent:FindFirstChild("HumanoidRootPart")
BP.Position = Vector3.new(0,0,0) -- example
wait(1)
debounce = true
end
end)
The answer may not even be one of these examples but I just need the best way
