Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How can i make a GUI element follow the mouse?

for example how can i make it to where when a mouse right clicks the Gui Element it will fade in a Hint that is right under the mouse until the mouse leaves the element. I know MouseEnter and MouseButton1Click, etc. But i have no idea how to make the hint follow the mouse.

1 answer

✓ Accepted answer

MouseObjects have two values:

Mouse.X -- 2d horizontal position
Mouse.Y -- 2d vertical position

Then, just make a while loop that repeatedly does this:

while HintIsOn == true do
	Gui.Position.Y = Mouse.Y
	Gui.Position.X = Mouse.X
	wait()
end

Hope I helped (note: these properties are read only) :)

2 comments

0

Cool This worked! Thank you for helping me, Now i've learned something new that i can use to my advantage on my next projects. :)

0

No problem :)

This discussion is preserved as it was. New answers, comments, and votes are closed.