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

Getting the mouse position on a gui?

What I need is to get the position of a mouse on a gui, not on the general screen.

You can sort of think of this as the screen being a town, the gui being a house, and the mouse being a person in that house that wants to know its position in the house. The house can be of any size, and so can the town.

I would need to get this from my mouse input.

3 comments

0

Really? I alreaady answered this. Make the mouse position nil

0

MouseEnter ( int x, int y )

0

@OverScores Will that return the position on the gui? or just its general position. Also SH, that wont work

1 answer

Its simple,

frame.InputBegan:connect(function(input)
	local x=input.Position.X-board.AbsolutePosition.X
	print(x)
end)

This gets the distance from the start of the gui, and prints it.

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