I'm trying to make a text label follow the player's mouse by creating an offset UDim2 and giving it the mouse X and mouse Y however this seems to be putting the text label off of the screen.
✓ ANSWER ACCEPTED
How would I convert mouse position to UDim2?
1 answer
✓ Accepted answer
Use offset values from Mouse.X and Mouse.Y;
Mouse.Move:Connect(function()
local position = UDim2.new(0, Mouse.X, 0, Mouse,Y)
GuiObject.Position = position
end)
1 comment
0
THANKS! :D
This discussion is preserved as it was. New answers, comments, and votes are closed.

8 comments
local pos = UDim2.new(0,mouse.Hit.p.X,0,mouse.Hit.p.Y)
Thanks!
np
Actually, mouse.p.X seems to be in the negatives
Label is off screen
strange
always worked for me
Mouse.Hit.Position is for the 3D position the Mouse is pointing at