How can I make a part stay in the center of the camera?

Hello, I’m trying to make a prop placement system, so I need to make a part/model stay in the center of the camera so that the player can place it wherever they want. I’ve tried changing the part’s CFrame to be the Camera’s CFrame position + an offset, like so:

game:GetService("RunService").Heartbeat:Connect(function()
	if Part ~= nil then
		Part.CFrame = CFrame.new(Camera.CFrame.Position + Offset,Camera.CFrame.Rotation.Position)
	end
end)

But the part won’t rotate with the Camera, staying at the character’s front when the Camera is rotated. However, if I multiply this CFrame by the Camera’s CFrame Rotation, like this:

Part.CFrame = CFrame.new(Camera.CFrame.Position + Offset) * Camera.CFrame.Rotation

this happens:
a1e2033a9a2daf436383510cefe183ce

How could I make it follow the camera’s rotation without this happening as well?
Any help would be appreciated. :smile:

1 Like

If you wanted you could probably apply an AlignPosition to the head and then use an offset to make it look like it’s in the middle of the camera.

1 Like
local OFFSET =  -- how far you want the part to be from the camera, number
Part.Position = Camera.Position + (Camera.CFrame.LookVector * OFFSET)

This should work

1 Like

Oh, that worked! Thank you so much!

1 Like