Whenever I change my NPC’s HRP’s position, only the HRP moves and the rest of the NPC is still at the same position. How can I fix this?
Im using Pathfinding so my NPC can go to the Finish Pad which will give the player 5 Brick Bux. I want the NPC to teleport back to were they originally started so they can give the player more money.
I have NOT Implemented the system were the player can teach the NPC on how to complete the Obstacle Course yet so some changes may come through.
Instead of manipulating the HumanoidRootPart Position, change the part CFrame. If it’s set as the PrimaryPart of the character model(which it does by default) it will move the entire model with it(the NPC).
Yes, although it will also reset the model rotation. If you want it to keep it unchanged you should do something like:
local Root = Character:FindFirstChild("HumanoidRootPart")
local Pos = Vector3.new(5, 3, 2) --new position
local Rot = Root.Rotation --new rotation(basically the old one)
local r = math.rad --CFrame.Angles accepts rotation as rads
--convert degrees to rads using the built-in function
Root.CFrame = CFrame.new(Pos)*CFrame.Angles(r(Rot.X), r(Rot.Y), r(Rot.Z))