Hi! - I use a center GUI for the crosshair, which renders the default cursor useless. However, upon clicking the mouse, the cursor overlays the crosshair. I've set up a basic script that attempts to do that - but the cursor still comes up when the player clicks.
local Player = Game.Players.LocalPlayer local Mouse = Player:GetMouse() Mouse.Icon = "rbxasset://textures/Blank.png" Mouse.Button1Down:connect(function() end)
How would I go about hiding the default ROBLOX cursor when the player clicks?
Thanks in advance, Dragon.
Perhaps I should also mention that is already inside of a Hopperbin.
Instead of using that, use the MouseIconEnabled
property of the UserInputService.
game:GetService("UserInputService").MouseIconEnabled = false --Hides the cursor game:GetService("UserInputService").MouseIconEnabled = true --Shows the cursor
In case you're interested, here's some more stuff you can do with the mouse that you may have not known about. (The page says it's available on GT2, but I believe most of those features are now available on regular Roblox.)
As stated on the PlayerMouse article,
trying to set the Icon will result in an error
In order to set the Icon
, you need to use a mouse derived from an equipped/selected Tool or HopperBin -- not the PlayerMouse gotten from GetMouse
.
Locked by 2eggnog, OniiCh_n, M39a9am3R, and Shawnyg
This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.
Why was this question closed?