So I'm trying to make this part practically follow the players torso but when I make it try to update and follow it doesn't work..
local Player = game.Players.localPlayer game.Players.PlayerAdded:connect(function(plr) plr.CharacterAdded:wait() plr.Character:WaitForChild("Torso") local torso = plr.Character.Torso local part = Instance.new("Part", game.Workspace) part.Transparency = 0.2 part.CanCollide = false part.Size = Vector3.new(4,4,4) while wait(0.1) do part.Position = CFrame.new(torso.Position) end end)
.
part.Position
requires a Vector3; you won't be able to give it something from CFrame.new
Simply
part.Position = torso.Position
will work (since both are Vector3s).
However, setting Position
will not move the object to precisely that point - it will set it on top, in the available space above.
Usually when moving objects, you want to use .CFrame
:
part.CFrame = CFrame.new(torso.Position)
or, if you want it to have the same orientation as torso
, simply use
part.CFrame = torso.CFrame