Arc Handles MouseLeave issue

Every time I try to detect MouseLeave event, it sends this error:
exception while signaling: Invalid value for enum Axis

Does this happen to anyone else? Here is my script if anyone needs to look into it (Sorry for the messy script):

function returnToNormalMouse()if(holding==false)then setMouse("default")end end
script.Handles.HANDLE_ROTATION.MouseLeave:Connect(returnToNormalMouse)

I even tried using pcall but it still wouldn’t work

function returnToNormalMouse()if(holding==false)then setMouse("default")end end
if(pcall(function()script.Handles.HANDLE_ROTATION.MouseLeave:Connect(function(...)returnToNormalMouse()end)end)==false)then returnToNormalMouse()end

I need help with this issue, Thanks for your answers.

2 Likes

Sorry, your script isn’t properly formatted, and I can’t really understand what’s happening. Can you give us a better formatted script? And in which line the error is at?

1 Like

You haven’t provided a lot of information and the format makes it hard to understand but from what I can see you are trying to set the mouse to its original icon?

local Players = game:GetService("Players")
local holding = false -- Assuming 'holding' is a variable defined somewhere
local player = Players.LocalPlayer
local mouse = player:GetMouse()

-- Function to set the mouse icon based on type
local function setMouse(mouseIconType)
    if mouseIconType == "default" then
        mouse.Icon = "rbxasset://SystemCursors/Arrow"
    elseif mouseIconType == "pointer" then
        -- Example: Set to a custom pointer asset, replace with your asset URL
        mouse.Icon = "rbxasset://SystemCursors/PointingHand"
    else
        warn("Unknown mouse icon type: " .. mouseIconType)
    end
end

-- Function to return mouse to default icon if not holding
local function returnToNormalMouse()
    if not holding then
        setMouse("default")
    end
end

-- Connect returnToNormalMouse function to MouseLeave event of HANDLE_ROTATION
script.Handles.HANDLE_ROTATION.MouseLeave:Connect(returnToNormalMouse)

1 Like

Ok here:

-- Returns mouse to normal (Works)
function returnToNormalMouse()
    if holding==false then
        setMouse("default")
    end
end

-- Connect function (Issue here)
script.Handles.HANDLE_ROTATION.MouseLeave:Connect(returnToNormalMouse)

This is the pcall one:

function returnToNormalMouse()
    if holding==false then
        setMouse("default")
    end
end

local success = pcall(function()
    script.Handles.HANDLE_ROTATION.MouseLeave:Connect(function(...) -- Gets variables but will not use (Thinked that it would work but it didn't help)
        returnToNormalMouse()
    end)
end)

if success==false then
    returnToNormalMouse()
end

The setMouse function works so there is really no need to provide it here, But if you do need it I can provide it anyway.

1 Like

The setMouse works so there is mostly no need to provide it, I tested the code you provided me but It still doesn’t work.
Error:
exception while signaling: Invalid value for enum Axis
Same error.

exception while signaling: Invalid value for enum Axis

The error typically indicates an issue with how an enumeration (like Axis) is handled within the script, rather than with the MouseLeave event itself. Could you provide the entire script? I suspect the issue might be related to HANDLE_ROTATION. Is HANDLE_ROTATION a valid GuiObject that supports the MouseLeave event?

Yes, I use it for rotating the part and it’s a normal roblox object classname ArcHandle. I don’t think I need to provide the whole script for a small issue like this…

Apologies for the confusion earlier. It appears that the issue stems from my misunderstanding of how ArcHandles work compared to standard GUI objects. According to the ArcHandles documentation, the MouseLeave event expects an axis argument to be handled correctly

" MouseLeave(axis : Enum.Axis):RBXScriptSignal

Fired when the mouse leaves the GUI handle."

This function should accept axis as a parameter to align with the ArcHandles’ event requirements.

local function returnToNormalMouse(axis)
    if holding == false then
        setMouse("default")
    end
end

I could be wrong though.

Still gives the same error sadly, I think this is Roblox’s problem.

is there a specific line where the error happens???

No, it doesn’t provide it but every time there is a MouseLeave activated in the HANDLE_ROTATE it gives an error…

Have you found an alternative for detecting when the mouse leaves the ArcHandle? .MouseLeave has been bugged ever since 8 FUCKING YEARS AGO but Roblox refuses to fix it:

Still no solutions yet, I have already discontinued the project containing this issue.
If there are any solutions, please let me know lol… :sweat_smile:

I reported the bug and got a Roblox engineer to look into it, who found the issue and will be fixing it in a future update:

I did send a bug report via Support with video proof like a year ago, but they just kept telling me to review over your code and giving me non-helpful tips.

I hope your report will be seen!

It already has been seen and a Roblox engineer has already stated that they will be sending an update reply in the bug report once the fix for it is live.

oh, great to hear! if it has been fixed, please let me know, thx!