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)