How would I attach a part to the players camera?

I saw this post and I want to try to recreate it but I have no idea on how to attach a part to the camera, can someone show me a way to do it?

2 Likes

In a LocalScript:

local rs = game:GetService("RunService")
local part = -- variable for your part
local offset = CFrame.new(0,0,0) -- offset between camera and part
local cam = workspace.CurrentCamera

rs.RenderStepped:Connect(function()
    part.CFrame = cam.CFrame * offset
end)
4 Likes

Thank you so much! :sunglasses: :+1: