TrackingPart = Instance.new("Part", game.Players.LocalPlayer) while true do TrackingPart.Parent = game.Players.LocalPlayer TrackingPart.Name = "TrackingPart" TrackingPart.Transparency = 1 wait(1) print(TrackingPart.Position) end
Its not moving the TrackingPart along with the humanoid.
You were setting the part's Parent to a value without a Position property. You need to set the Position property of the part to the character in workspace
local player = game.Players.LocalPlayer -- This variable does not represent your player in workspace. local char = workspace:WaitForChild(player.Name)-- This variable represents your player in workspace. local hrp = char:WaitForChild("HumanoidRootPart") -- this is a variable for the HumanoidRootPart of your player in workspace. local part = Instance.new("Part") part.Name = ("TrackingPart") part.Size = Vector3.new(2,2,2) part.Transparency = 1 part.Anchored = true part.Parent = char -- parent the object into 3D space after setting its properties, not before while true do wait() part.Position = hrp.Position - Vector3.new(2,-2,2) -- this will offset the HumanoidRootPart position and position the part away from it slightly end
I've had the same issue trying to add fire to a player! R6-only games:
local TrackingPart = Instance.new("Part") local player = game.Players:GetFirstChild("Humanoid").Torso -- Any other body part will not work for R6 TrackingPart.Position = player.Position TrackingPart.Parent = player TrackingPart.CanCollide = false -- If can collide is on the player may glitch TrackingPart.Transparency = 1 TrackingPart.Anchored = true -- We do not want the part to fall while true do wait(1) print("The tracking part has seen the user at "... TrackingPart.Position... ".") end
R15-only games:
local TrackingPart = Instance.new("Part") local player = game.Players:GetFirstChild("HumanoidRootPart").Torso -- Any other body part will not work for R15 TrackingPart.Position = player.Position TrackingPart.Parent = player TrackingPart.CanCollide = false -- If can collide is on the player may glitch TrackingPart.Transparency = 1 TrackingPart.Anchored = true -- We do not want the part to fall while true do wait() part.Position = player.Position - Vector3.new(2,-2,2) end while true do wait(1) print("The tracking part has seen the user at "... TrackingPart.Position... ".") end -- It is recommended to put two separate while true do's or the wait will interfere with the other while true do
If none of these work, get back to me asap!