PcoWSkbVqDnWTu_dm2ix
The Developer Hub is now deprecated and information on this page may no longer be accurate. To see our new and improved documentation, please click here. You can read more about the future of documentation here.
Collapse Sidebar

MouseIconEnabled

UserInputService

bool

This property determines whether the Mouse|Mouse’s icon is visible When true the mouse’s icon is visible, when false it is not.

For example, the code snippet below hides the mouse’s icon.

local userInputService = game:GetService("UserInputService")

userInputService.MouseIconEnabled = false

As UserInputService is client-side only, this property can only be used in a LocalScript.


Code Samples


Hide Mouse During Keyboard Input

This example hides the mouse icon while the player beings using their keyboard, such as to chat or enter text into a TextBox. The mouse icon reappears when the user resumes mouse input.

This uses the UserInputType/LastInputType|LastInputType event to determine when the user begins keyboard input and mouse input - based on the value of the Enum/UserInputType/lastInputType argument.

In order for this example to work as expected, it should be placed in a LocalScript.