Teleporting Character - Server and Client Out Of Sync

Teleporting Character - Server and Client Out Of Sync


Hello everyone! I am really confused why this is happening. Before I explain, here are a few pictures of what is going on:


Server:


Client:
Teleportation Is Weird 2.PNG


What I Did:

  • Moved the character’s RootPart to a new position.

What happened:

  • The character’s model is offset from the RootPart, which is in the correct location. The character appears normal on the client, but the characters rig is in the wrong location.

What Am I Trying To Do:

  • I am trying to move the character to a new location. I am planning on using the server for hitboxes later so I need the character’s rig to be in the correct location.

What Have I Tried:

  • I have tried setting and tweening the character’s rootpart position.

Thanks for reading! Thanks in advance if you can help me with this!

1 Like

My goodness! Roblox physics are so incredibly stupid. I use a function, :MoveTo(), that literally does the exact same thing (gets rootpart then sets it’s position) and it works. Working with humanoids is so frustrating.

Edit: Looks like MoveTo is a bit different, I was thinking of translate by. Thanks for the help everyone!

Problem:

  • Setting position breaks rig’s joints

Solution:

  • Use model:MoveTo
  • Set RootPart CFrame
1 Like

Setting CFrame rather than Position also works. Setting Position will break joints for whatever reason.

4 Likes

I have a bit of an issue with @PseudoPerson’s answer.

I really dislike :MoveTo() and I think that the only time you would use it is when you’re uncertain of where you’re moving the character.

The :MoveTo() method functions in a similar way to how your character will spawn on a SpawnLocation, it will find the nearest open location above to place you. Obviously this is not good if you want the player to go somewhere exactly.

Instead I almost always just use this bit of code:

Character:SetPrimaryPartCFrame(CFrame.new(Position)) 

:MoveTo() totally works, but I personally believe it’s not worth using in most cases.