Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

how to make screen gui follow your mouse?

Asked by
ax_gold 360 Moderation Voter
6 years ago

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

Log in to vote
0
Answered by
GingeyLol 338 Moderation Voter
6 years ago
Edited 6 years ago
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
while wait() do
script.Parent.Position = UDim2.new(mouse.X,0,mouse.Y,0)
end
0
replace the wait() with true CrastificeDude612 71 — 6y
0
with what? a event connected function? GingeyLol 338 — 6y
0
the textbutton just disappears... ax_gold 360 — 6y
0
can you... GingeyLol 338 — 6y
Ad

Answer this question