Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to teleport an entire character instead of one part of your character?

Hey guys,

I'm trying to make a white frame to cover your screen, and then, the script will teleport you to a part.

Teleporting works, but it only teleports one part of your body (HumanoidRootPart, Head, Left leg, etc.) and it glitches out. So, is there any way I can teleport the entire body without having to write many lines of code?

By the way, here is the teleporting code that glitches you out:

game.Players.LocalPlayer.Character.HumanoidRootPart.Position = game.Workspace.randomparts.teleportpart.Position

Thanks!

2 answers

✓ Accepted answer

I'm gonna explain this clearly. Use CFrame because it will teleport all of the parts instead of one specific part. Using Position uses Vector3 values, which will obviously kill your character if you try to move it. So using CFrame should do the trick.

game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = workspace.randomparts.teleportpart.CFrame

3 comments

0

Thanks!

0

Also, one more tip, it's best to use the function :SetPrimaryPartCFrame because if you don't the script can cause latency problems and issues in the game, it can also create lag which is not what you want.

0

@JesseSong quick question, what does :SetPrimaryPartCFrame do?

Use CFrame

Example:

game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(X,Y,Z)

2 comments

0

I wish I could accept 2 answers... Thanks for answering, though!

0

the cframe is easy

This discussion is preserved as it was. New answers, comments, and votes are closed.