I am trying to make a part that points to the player where ever they move, I have tried using, https://developer.roblox.com/en-us/articles/Understanding-CFrame, To get a better understanding of cframe. I have made a script but nothing comes up in the output, neither does the cube move, does anyone know how to answer this?
wait (2)
local cube = game.Workspace.Cube
local player = game.Players.LocalPlayer.Name
local targetPosition = player.HumanoidRootPart.Position
while true do
cube.CFrame = CFrame.new(cube.Position, targetPosition)
end

3 comments
wait! i know! You are using "game.Players.LocalPlayer.Name" that gets the name of the player, this has no position, use "game.Players.LocalPlayer.Character"
sorry, the players name has no HumanoidRootPart inside it
Oh. Put that as an answer, I will accept it, if it works ofc.