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 | local player = game.Players.LocalPlayer |
2 | local mouse = player:GetMouse() |
3 | while wait() do |
4 | script.Parent.Position = UDim 2. new(mouse.X, 0 ,mouse.Y, 0 ) |
5 | end |