Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I get the mouse position relative to an GUIObject?

Basically I am trying to detect the mouse position relative the position of a GUI Element. Currently this is what I have:

UDim2.new(0, Mouse.X*Object.Position.X.Scale, 0, Mouse.Y*Object.Position.X.Scale)

But that isn't quite working and setting the AnchorPoint is not helping.

1 answer

✓ Accepted answer

You can use: ~~~~~~~~~~~~~~~~~

UDim2.new(0, Mouse.x-GuiObj.Parent.AbsolutePosition, 0, Mouse.y-GuiObj.Parent.AbsolutePosition)


1 comment

0

thanks

This discussion is preserved as it was. New answers, comments, and votes are closed.