Create a way to read mouse location inside plugin dock widgets

As a Roblox developer, it is currently difficult to get mouse location inside a plugin dock widget. Right now, the only way to get this information (the way RbxGui handles it) is by creating a “soak” UI element that uses the MouseMoved event of a text button with a size of UDim2.new(1,0,1,0), which passes mouse x and y as parameters.

My use case is creating sliders for my terrain plugin, but I’m sure anyone could imagine the benefit of being able to properly get the mouse location. The current hacky method of achieving this is just another example of the several things that make plugin development a nightmare and why so many developers are deterred from creating their own tools.

There is an API for this: PluginGui:GetRelativeMousePosition(). I don’t know why it’s not documented on the PluginGui page though.

2 Likes

Ah excellent thanks, I guess I’ll take my issue to my recent favorite category, documentation requests

1 Like