How would I teleport the player into the direction they are moving?

Hey there! I’m trying to make the player teleport into the direction they are moving. Here’s what I’ve tried so far:

(Server Script)

local direction = (humanoidRootPart.Position - moveDirection).Unit
print(direction)
humanoidRootPart.Position = humanoidRootPart.Position+direction*10

moveDirection is humanoid.MoveDirection.

It just teleports me into unexpected directions, even when i do -direction. Is there a better way to get the player to teleport into the direction they are walking?

Any help is greatly appreciated!

2 Likes
humanoidRootPart.CFrame = humanoidRootPart.CFrame + humanoidRootPart.CFrame.LookVector * Vector3.new(10, 0, 10)
1 Like

That would teleport the player forward, not into the direction they are walking. I am forcing shiftlock.

You might be able to use the player’s camera CFrame.

local Distance = 100
Character:PivotTo(CFrame.new(RootPart.Position + RootPart.AssemblyLinearVelocity.Unit * Distance))

This is exactly what I was looking for, thank you!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.