Hello! I have been trying to make a function that will detect if a gui object is visible in the frame it is in. I am using this so I can create my own custom click detection on a button (I have my reasons for that). But I need to check if you can actually click the button object! I'm using this for a scrolling frame.
Here's what I've tried:
function isclipped(v)
local a = v.AbsolutePosition.X < v.Parent.AbsolutePosition.X + v.Parent.AbsoluteSize.X
local b = v.AbsolutePosition.X > v.Parent.AbsolutePosition.X
local c = v.AbsolutePosition.Y < v.Parent.AbsolutePosition.Y + v.Parent.AbsoluteSize.Y
local d = v.AbsolutePosition.Y > v.Parent.AbsolutePosition.Y
if a and b and c and d then
return true
else
return false
end
end
It practically doesn't work at all ):
Anyone who has done this before or knows how to fix it, please give me some help.
Thanks (:
