Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Moving only the Torso/HumanoidRootPart and not the character?

Asked by 5 years ago

Basically when you spawn in it is supposed to move/teleport your character in a different location of game. (Example where you came from), first it wasn't working at all now it is working thanks to the last question I asked.. But, it's only moving the torso if I say Torso. If I say Humanoid it says it isn't valid and if I say HumanoidRootPart it just moves the humanoidrootpart and not the whole player itself.

1local Data = game:GetService("TeleportService"):GetLocalPlayerTeleportData()
2 
3print (Data)
4 
5if Data then
6    wait(.5)
7    game.Players.LocalPlayer.Character:FindFirstChild("HumanoidRootPart")
8    game.Players.LocalPlayer.Character.HumanoidRootPart.Position = Vector3.new(-227.2, 150.2, -236.2)
9end

1 answer

Log in to vote
1
Answered by 5 years ago
Edited 5 years ago

You cannot move a player/NPC using a Vector3 value, you need to use a CFrame value, otherwise it will only change the HumanoidRootPart's position and it won't affect the other player parts, using a CFrame value you'll be changing the HumanoidRootPart's CFrame position and that will affect all of the other player parts.

Try changing this:

1game.Players.LocalPlayer.Character.HumanoidRootPart.Position = Vector3.new(-227.2, 150.2, -236.2

To this:

1game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(-227.2, 150.2, -236.2)

And see if it works.

0
Thank you so much, I didn't know that. Only you and one other guy were really helpful. The other people I asked on the discord were toxic, so this means a lot. panichub 29 — 5y
Ad

Answer this question