Mouse position is always the same in plugins?

I don’t know if this is intentional or not, but whenever I try to get mouse location like:

local UserInputService = game:GetService("UserInputService")

print(UserInputService:GetMouseLocation())

or:

local Mouse = plugin:GetMouse()

print(Mouse.X,Mouse.Y)

I always get the same position. Is there any way to get mouse location in plugins?

wdym “in plugins” like in their own widget? You have to get its dock widget and then insert your own frame and then when do Frame.InputChanged:Connect(function() end) then you can listen for when the mouse moves on that dock widget.

This is kind of a hacky way of doing it. I found another way described here:

1 Like

I’m not experienced at ALL with plugins, but perhaps this would work?

local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")

local MousePosition

RunService.Heartbeat:Connect(function()
   MousePosition = UserInputService:GetMouseLocation()
end)
1 Like

those only work inside of the game dock, not the plugin dock. UserInputService is only game dock