local plyr = game:GetService("Players").LocalPlayer local mouse = plyr:GetMouse() local Frame = plyr.PlayerGui.ScreenGui.Frame Frame.Visible = true while true do wait() Frame.Position = (mouse.Hit) end
In this LocalScript it changes the frame to visible but does not move it to the mouse position. I Read on the Roblox Wiki that "Hit" is "The position of where the mouse is pointing." so i tried to do this myself but failed :3
Hope Sombody can help, Thanks.
There are multiple reasons it errored:
This is like Vector2. There is an X and Y axis. UDim2 also has an X and Y axis but the main difference is that there are things called Scale and Offset.
UDim2.new(0,1,1,0) --Would show up like this {0,1},{1,0}
local plyr = game:GetService("Players").LocalPlayer local mouse = plyr:GetMouse() local Frame = plyr.PlayerGui.ScreenGui.Frame Frame.Visible = true mouse.Move:connect(function() Frame.Position = UDim2.new(0,mouse.X,0,mouse.Y) end)
Hope it helps!
The gui will be in a weird position, it's just how ROBLOX is.