I'm currently making an anti-virus plugin, and I tried implementing a hint system (where a gui would display text when you hover over a gui button and track the mouse). Although, I realised soon after that this was not acting like I would have expected it to act in a normal server.
Firstly:
I am using the MouseEnter, MouseLeave and MouseMoved events on the GUI instances, then moving them to a position using the mouse's X and Y coordinates.
This is an example code (I couldn't be bothered to get it, lol):
Gui.MouseEnter:connect(function() Hint.Text = "Hm" Hint.Size = UDim2.new(0, Hint.TextBounds.X, 0, 16) Hint.Position = UDim2.new(0, Mouse.X, 0, Mouse.Y) Hint.Visible = true end) Gui.MouseMoved:connect(function() Hint.Position = UDim2.new(0, Mouse.X, 0, Mouse.Y) Hint.Visible = true end) Gui.MouseLeave:connect(function() Hint.Visible = false end)
And before you ask, I have already:
Here is a GIF of the problem that I had:
(First number = Mouse.X, Second number = Mouse.Y)
The same X,Y coordinates were being recorded from the MouseEnter, MouseMoved and MouseLeave events... And yes, I did move the mouse...
So, anyone got any ideas to fix/bypass this problem?
(If anyone's REALLY interested, then here's the Plugin
I assume you're using the this Mouse object (or the PluginMouse, which apparently works the same). My guess is that it doesn't update its coordinates when its over a GUI.
Fortunately, both MouseEnter and MouseMove provide x and y coordinates as coordinates, so you can use those instead of Mouse.X and Mouse.Y.
If that doesn't work, I'd recommend trying InputBegan, InputChanged, and InputEnded (to replace MouseEnter, MouseMove, and MouseLeave, respectively). You may wish to ignore certain types of input (ex just listen to MouseMovement )