When I move the mouse around I want the gui to follow it.
plr = game.Players.LocalPlayer mouse = plr:GetMouse() Gui = script.Parent.Text Gui.Position = UDim2.new(mouse)
First problem:
:GetMouse
does not return a position value. To fix this, do the following:
local pos = mouse.Position Gui.Position = pos
Second problem:
This will only cover the mouse once, so it will not update itself, so:
while wait() do local pos = mouse.Position Gui.Position = pos end
Tips:
Shawnyg's comment was wrong, it does not interfere, and will only interfere when you are searching for a child of an object with a Text property, when the child you are searching for is called Text
. If you encounter this problem, consider renaming the child text
, as the searches are case sensitive.
Always make sure something that needs to be updated is actually updating, see the second problem.
Hope I helped :)
~TDP