Trying to compare Vector2 values to detect if guis collide. The reason why I cannot just do == is because it will not be exactly the amount. Here is my function:
function checkPosition(gui1, gui2)
local gui1_topLeft = gui1.AbsolutePosition
local gui2_topLeft = gui2.AbsolutePosition
local math1 = Vector2.new(gui2.AbsoluteSize.X/2)
local math2 = Vector2.new(gui1.AbsoluteSize.X/2)
return (gui2_topLeft + math1 < gui1_topLeft - math2)
end
What is your thoughts? Is there something I am missing? Should I use something that is not Vector2? Let me know if you have any questions! Thanks, Jail.

4 comments
There is an issue here, instead, it results with this error: invalid argument #2 (Vector2 expected, got number) Got any suggestions?
Hmm...
I dont really have any thing...
Should you add a If statement to detect if its there?