Making an attachment point towards the mouse

I’m trying to get an attachment to point towards the mouse, but it just points to somewhere off the baseplate and the orientation is very very slightly affected by the mouse when I move it. I’m unsure what I’m doing wrong, as I’ve never used Orientation over CFrame before.

		local CF = CFrame.new(Player.Character.RightHand.Position,Hit.Position)
		EmitterAttachment.Orientation = Vector3.new(CF:ToOrientation())

You should be setting the CFrame

local cfLookAt: CFrame = CFrame.lookAt(Player.Character.RightHand.Position, Hit.Position)
EmitterAttachment.CFrame = EmitterAttachment.Parent.CFrame:toObjectSpace(cfLookAt)
1 Like