When dragging mouse rotate dummy

So I want to make it so when you click and drag the mouse it rotates around the x axis

What I want:
https://gyazo.com/1588b496e5853ada710531c1a8d9f6fc
What I have:
https://gyazo.com/06305c21abea61d5488d5d90911ab897

The code I’m using:

local moving = false

mouse.Button1Down:Connect(function()
	moving = true
	mouse.Move:Connect(function()
		if moving then
			local mousePosition = mouse.Hit.p
			local orientationDirection = Vector3.new(mousePosition.X, workspace.Dummy.PrimaryPart.Position.Y, mousePosition.Z)
			workspace.Dummy:SetPrimaryPartCFrame(CFrame.new(workspace.Dummy.PrimaryPart.Position, orientationDirection) *CFrame.Angles(0, math.rad(1), 0))
		end
		
	end)
end)

mouse.Button1Up:Connect(function()
	moving = false
end)

what you are doing is basically making the dummy to look at the Mouse position there is actually a topic with what you said and it has a solution with a code that might help you

1 Like

Ok I will look at it now thnanks :slight_smile:

1 Like

Thank you so f ing much bro it worked :grinning_face_with_smiling_eyes: