ArcHandles not registering MouseButton1Up

Hello,

I am working on a plugin that uses an ArcHandle to rotate a selected part.

ArcHandles.MouseDrag:connect(function(axis, angle, radius)
if axis == Enum.Axis.X then
selected[1].CFrame=selected[1].Parent.CFrame.Value*CFrame.Angles(angle,0,0)
end
end)

ArcHandles.MouseButton1Up:connect(function(axis)
print(“Mouse was released”)
end)

The first part runs fine, and rotates the part exactly how I need it to. But the event function I have afterwards for MouseButton1Up doesn’t seem to fire whenever I release the mouse.
Any ideas on how I can resolve this?

The MouseButton1Up only fires if the mouse is still hovering over one of the arc handles. To avoid this being the case, you can register the mouse going down when ArcHandles.MouseButton1Down is fired and use UserInputService.InputEnded to register mouse going up.

Here’s the code:

local inputServ = game:GetService("UserInputService")

ArcHandles.MouseDrag:Connect(function(axis, angle, radius)
	if axis == Enum.Axis.X then
		selected[1].CFrame = selected[1].Parent.CFrame.Value*CFrame.Angles(angle,0,0)
	end
end)

ArcHandles.MouseButton1Down:Connect(function(axis)
	print("Mouse is down")
	
	local mouseDownEv
	mouseDownEv = inputServ.InputEnded:Connect(function(input, processed)
		if input.UserInputType == Enum.UserInputType.MouseButton1 then
			print("Mouse was released")
			mouseDownEv:Disconnect()
		end
	end)
end)

Hopefully this helps!

That’s crazy! For regular handles it fires even if the mouse isn’t still over it, but anyway. Thank you this works, I appreciate the help!

Yeah, it’s rather odd behaviour and has actually been reported as a bug before (back in 2015)

1 Like