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

Help detecting GUI Collision?

I tried to make a function that detects collision, but it is faulty. Could someone please make it better?

function withingui(gui,position)
	if
		position.X.Offset >= gui.Position.X.Offset and
		position.X.Offset <= gui.Position.X.Offset+gui.Position.X.Offset and
		position.Y.Offset >= gui.Position.Y.Offset and
		position.Y.Offset <= gui.Position.Y.Offset+gui.Position.Y.Offset
		then
		print("Intersecting")
		return true
	else
		return false
	end
end

1 answer

As ScriptingHelpers rule says:

Don't ask for codes, explain your problem and then we try to help you.

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