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

how to make screen gui follow your mouse?

I want to make a popup from screen gui in my game that moves along with the mouse like a window on your computer. It's not just simply UDim2.new(0,mouse.X, 0,mouse.Y), because that sets the position based on the AnchorPoint. I know it's possible because you can do it with the developer console. Does anyone know how to do it specifically?

1 answer

local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
while wait() do
script.Parent.Position = UDim2.new(mouse.X,0,mouse.Y,0)
end

4 comments

0

replace the wait() with true

0

with what? a event connected function?

0

the textbutton just disappears...

0

can you...

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