Currently, I'm working on recreating a failed GUI that I made a few days back, and hit a roadblock when it comes to the title. Currently, I'm using the following lines:
local mouse = game.Players.LocalPlayer:GetMouse() local gui3 = game.Players.LocalPlayer.PlayerGui.Gui3 gui3.Text.Position = UDim2.new(mouse.X, mouse.Y)
This, to my knowing, is not working. This is contained in a local script, and is in a function which activates when the mouse moves (I'm sure that the function activates properly).
Thank you for reading, and I look forward to finding a solution!
You problem is that UDim2
requires four sets of x/y coordinates. It works like this,
UDim2.new(scaleX, offsetX, scaleY, offsetY)
Scale is a percentage, while offset is a specific number of pixels. Which one you use depends on if you want the GUI size and position to vary on different screen sizes or not. Also note that although scale is a percentage, it is converted to a decimal, so you must give it a number between 0 and 1, Much like a part's Transparency.
Since mouse.Y
or mouse.X
returns a number of pixels, you will probably want to use offset.
UDim2.new(0, mouse.X, 0, mouse.Y)
I'll send you a pm on roblox later when I get homeand I'll fix it :)
Locked by adark and Perci1
This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.
Why was this question closed?