What is the best way to move a character?

I was wondering, what is the best way to move players (say, to a spawnpoint in a map)? I already know of setting the HumanoidRootPart’s CFrame and using char:MoveTo(), but what else?

5 Likes

AFAIK CFrame is the best method, why are you looking for others if this one works perfectly fine?

Sometimes CFraming the HumanoidRootPart causes my character to die because of head dislocation…

Humanoid:MoveTo is probably your best bet, however if you need instant movement, simply setting the CFrame of the player’s primary part to the desired endpoint works fine.

3 Likes

Wait… Humanoid:MoveTo not character:MoveTo??

yes, humanoid move to works much better for moving players and npcs

Use Character:SetPrimaryPartCFrame(cframe)

Character:MoveTo() teleports the character above the part if there are no ovjects that don’t allow this, and Humanoid:MoveTo() makes the character move to the part.

3 Likes

@palarc1 This would be your solution here.

SetPrimaryPartCFrame will, by default, also maintain proper relative position and orientation to the root part (in this case, the HumanoidRootPart). In regards to geometry calculation, this may also be more efficient.

I would mark their post as a solution (will be possible once you move this post to the correct category).

Sidenote, this is the incorrect category, I would recommend moving this to #help-and-feedback:scripting-support ^-^

Char:MoveTo is a good way, or Humanoid:MoveTo. I would use those more for character type things, as it’s just better and keeps efficiency and organization in your scripts.

I would recommend Character:MoveTo() or Humanoid:MoveTo() because I have been having an issue where players go invisible when setting the CFrame of the root part.

1 Like