Click and drag to rotate character on customization menu

Hello! This is my customization menu:

I want to make it so u can click and drag to rotate the character. How should I go about doing this? Thanks for any help in advance! I tried searching and couldn’t find anything useful on this.

https://gyazo.com/1588b496e5853ada710531c1a8d9f6fc here is an example of what I want
Theres also a post previously made that I found but the solution didnt help me.
When dragging mouse rotate dummy

Hi there! This can be achieved by checking if the player’s mouse is dragging, then calculating the distance, something like this:

local plr = game.Players.LocalPlayer
local mouse = plr:GetMouse()

mouse.Button1Down:Connect(function() -- check if mouse is down
	lastPosition = Vector2.new(mouse.X, mouse.Y)
	mouse.Move:Connect(function() -- check if mouse is moving
		local currentPosition = Vector2.new(mouse.X, mouse.Y) 
		local deltaPosition = (currentPosition - lastPosition) -- calculates amount moved
		lastPosition = currentPosition
	end)
end)

mouse.Button1Up:Connect(function() -- checks when mouse released
	lastPosition = Vector2.new(mouse.X, mouse.Y)
end)

After doing that, simply rotate the humanoid’s character by the mouse’s dragged amount on the x axis like so:

character:SetPrimaryPartCFrame(character:GetPrimaryPartCFrame() * CFrame.Angles(0,amountchanged.X,0))

You also want to keep a variable that checks if the mouse is moving, and set that variable to false when the mouse is released. Apologies if these snippets of code don’t work, I threw them together without any testing. Also they would need a bit of tweaking to actually get to work.

Hope this helps!