Character:MoveTo Moving The Player Too High

Hello!

In my game, I use Character:MoveTo often and it works most of the time. However, sometimes it doesn’t and it teleports the player on the roof instead of the part. If anyone has a solution, that would be great.

An example how I use it:
Character:MoveTo(LobbyTp.Position)

Thanks in advance! :smiley:

1 Like

Wait I am confused, do you use :MoveTo() for teleporting the player?

1 Like

Thanks for the reply! To answer your question: Yeah…?

Just do this:

Character.HumanoidRootPart.Position = LobbyTp.Position
2 Likes

This is expected behavior as stated on the documentation for Model:MoveTo()

" If there are any obstructions where the model is to be moved to, such as Terrain or other BasePart s, then the model will be moved up in the Y direction until there is nothing in the way. If this behavior is not desired, Model:SetPrimaryPartCFrame should be used instead."

You can read more here

Your best best for fixing this issue is just replacing Model:MoveTo() with Model:SetPrimaryPartCFrame().

3 Likes

I think a better way to teleport would be doing’

player.Character.HumanoidRootPart.CFrame = part.CFrame + Vector3.new(0,0,0) -- this happens in an instant and you are able to control the height by changing the middle number
3 Likes

Awesome! I’ll try all these out and see which works best! :smiley: