Moving the players mouse

Hello everyone, I have a question, first of all is it posible to move a players cursor through the screen without the player needing to intervine? Like can I move the cursor because of a script and not the player?

If so how can I do it? I’m thinking on using Mouse.Position but I’m not to sure that it is a real property.

1 Like

You can’t, the only API’s for modifying how the user can move the mouse are UserInputService.MouseBehavior and UserInputService.MouseDeltaSensitivity

You might want to support a feature request to add this functionality:

3 Likes

Create a new Mouse image, And disable the normal mouse. Then use a render loop to update that mouse icon to the real mouse location.

You can move this fake mouse icon wherever you want. :+1:

Edit: For pressing buttons. Create a table of buttons you might press and the function when it will be executed. Then you can automatically fire those button functions or connect it so when MouseButton1 is clicked. The button function is fired.

You could also just remake the mouse on a big scale and fix alot of issues roblox hasn’t fixed yet. Such as the 1 object & its descendants ignoring property.

1 Like

I think I will do that, thank you very much.

Well I would do that, but I need to move the cursors true location, since I’m trying to not trigger a gui Gui.MouseEnter

You can still disable the mouse icon and create your own icon. Things like MouseEnter will still work as you just hid the icon.

game:GetService("RunService").RenderStepped:Connect(function()
  FakeMouseIcon.Position = UDim2.new(0, Mouse.X, 0, Mouse.Y)
end)

If you don’t want to trigger an event for some reason. Make sure that the function connected to the event can’t do anything

Gui.MouseEnter:Connect(function()
  if not MouseEnterable then return end

  ...
end

Or you could go above again, And use attributes.

Gui.MouseEnter:Connect(function()
  if not Gui:GetAttribute("MouseEnterable") then return end

  ...
end
2 Likes