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 4 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.

local Data = game:GetService("TeleportService"):GetLocalPlayerTeleportData()

print (Data)

if Data then
    wait(.5)
    game.Players.LocalPlayer.Character:FindFirstChild("HumanoidRootPart")
    game.Players.LocalPlayer.Character.HumanoidRootPart.Position = Vector3.new(-227.2, 150.2, -236.2)
end

1 answer

Log in to vote
1
Answered by 4 years ago
Edited 4 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:

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

To this:

game.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 — 4y
Ad

Answer this question