I’m trying to make a script which teleports the player through a portal after sliding down a slide, however after completing the slide, the vector from the slide stays within the character and “flings” the character away from the finishing area (as seen in this video):
What can I do to make it so that the player doesn’t get “flung” like this after being teleported through the portal?
I tried resetting the character and anchoring the root part for a second after being teleported, to no avail.
Here’s the script managing the portal:
local TeleportPart1 = script.Parent.TeleportPart1
local TeleportPart2 = script.Parent.TeleportPart2
TeleportPart1.Touched:Connect(function(hit)
local w = hit.Parent:FindFirstChild("HumanoidRootPart")
if w then
w.CFrame = TeleportPart2.CFrame + Vector3.new(0, 5, 0)
TeleportPart2.CanTouch = false
wait(1)
TeleportPart2.CanTouch = true
end
end)