I'm making a game with a custom mouse, and I don't want to use mouse.Icon because it's broken. Is there anyway to detect when the mouse is moved, then update the frame's position to the mouse's position?
✓ ANSWER ACCEPTED
Any way to get the player's mouse position?
1 answer
✓ Accepted answer
You can use the Mouse's .Move signal to run code respectively when the Cursor's position changes. Using Mouse.Y and Mouse.X in conjunction, we can get the current UDim2 position on screen, and assign it to our customary Cursor.
To actively hide the main Cursor, we can use UserInputService's MouseIconEnabled property to make it invisible
RemoveMouseLocalScript
local UserInputService = game:GetService("UserInputService")
UserInputService.MouseIconEnabled = false
CustomCursorLocalScript
local Player = game:GetService("Players").LocalPlayer
local Mouse = Player:GetMouse()
local Cursor = script.Parent
Mouse.Move:Connect(function()
local MousePos = UDim2.new(0, Mouse.X, 0, Mouse.Y)
Cursor.Position = MousePos
end)
Note:
Ensure you set the AnchorPoint of the customary Cursor GUI to .5,.5, so we can center it.
This discussion is preserved as it was. New answers, comments, and votes are closed.

7 comments
Moved is not a valid member of PlayerMouse?
Apologies, Move*
The event is called "Move" not "Moved". Also, it says "Udim2 was expected ,got vector2, which isn't a surprise, but I don't know how to fix this.
Ah, right. My bad once again. I just finished a late assignment so I’m a tad bit tired at the moment.
Try the code once more
Figured it out. Problem was the mouse.x and mouse.y was in the wrong order.
That is embarrassing;) Happy to have helped