How can I have a part always 5 studs in front of my player (direction facing)

Currently I’m just doing this, but not sure how to go about getting the part to be always in front of the direction the player faces?

X=script.Parent
local player = workspace:WaitForChild("matt1020304050")
while true do
X.PrimaryPart.Position = player.Head.Position + Vector3.new(0,5,10)
wait (0.01) --How long the script waits before moving the model again.
end 
local X = script.Parent
local player = workspace:WaitForChild("matt1020304050")

while true and task.wait(0.01) do 
	X.PrimaryPart.CFrame = player.HumanoidRootPart.CFrame + player.HumanoidRootPart.CFrame.LookVector * Vector3.new(5, 0, 5)
end
3 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.