`MouseIconEnabled = false` state ignored whenever the cursor (re)enters the window, cursor will always be shown

Reproduction Steps

Run this in a LocalScript:

game:GetService("UserInputService").MouseIconEnabled = false

Note how the cursor icon is disabled when joining the game.

On Windows 10, with a maximized Roblox window (but not fullscreen), try to move the (invisible) cursor to the title bar at the top of the screen. This moves the cursor outside of the Roblox rendered area. The (system) cursor appears as expected. Now move the cursor back down again. Note that the cursor remains visible, even though MouseIconEnabled still is false.

Opening and closing the Roblox menu (Esc) does restore the hidden-icon-state again, though. Setting MouseIconEnabled to true for a frame, then false again also seems to force it to hide again.

This only happens in the player client. It does not reproduce in Studio for me.

It also happens when moving the cursor between other applications, but the previous technique is probably the easiest to reproduce it reliably.

This started to happen this week.

Expected Behavior

The cursor to return to a hidden state as soon as the cursor re-enters the Roblox window.

Actual Behavior

See the reproduction steps above.

Workaround

See above (not really a workaround, though). I suppose you could set the cursor’s icon to a transparent image too…

Issue Area: Engine
Issue Type: Display
Impact: Moderate
Frequency: Constantly
Date First Experienced: 2022-05-10 00:05:00 (+02:00)

7 Likes

Thanks for the report, I was able to reproduce it. I’m looking into it.

6 Likes

Seconding this, I made a custom cursor script and have been encountering this issue. This only seems to occur in the ROBLOX client and not in Studio, by the way.

I enabled the fix for this today. The bug shouldn’t occur anymore.

4 Likes

Thanks for the fix!

I did get a report about this issue seemingly occurring on MacOS as well (even after this fix got enabled), with the same reproduction steps. I cannot verify this on MacOS myself at this time, though. On Windows this issue did get fixed for me.

1 Like

Ah, my fix was only for Windows. I’ll look into the macOS side as well.

2 Likes

Please also look into setting custom images to the roblox cursor, I’ve created a custom cursor system that worked fine weeks ago but now whenever I enter the game I get the default roblox cursor instead of my custom gun cursor/crosshair.