function IsGUIObjectOnScreen(Object)
local CurrentCamera = workspace.CurrentCamera
local ScreenSize = CurrentCamera.ViewportSize
local Position, Size = Object.AbsolutePosition, Object.AbsoluteSize
local Bounds = {
X = {
Min = -Size.X,
Max = ScreenSize.X
},
Y = {
Min = -Size.Y - 36,
Max = ScreenSize.Y - 36
}
}
if Position.X <= Bounds.X.Min or Position.X >= Bounds.X.Max then
return false
elseif Position.Y <= Bounds.Y.Min or Position.Y >= Bounds.Y.Max then
return false
end
return true
end
An object is deemed “off screen” if there is no visible part of it. Do note: you may need to remove the - 36 in the Bounds if you have this option enabled in your ScreenGui:
Okay, I’m not asking personal questions either. I’m trying to figure out what you’re trying to do which you want help with. You haven’t provided any script or even screenshot of how you are defining your frames. I think it will make a difference if you’re using scale vs offset. I’m not sure what the screenshots you keep showing are showing us. Is that transparent orange box your frame that you’re testing? What is the red part? Does that change colors depending on the test?
im using offset, i set the frame in the function to the frame you can see in the image,
and i already explained that ‘red part means function gave me false’
Okay, so 1 is the right side, and 1 is the bottom. Depending if you have your anchor centered or top left, you need position of 1.516 to get off the right side, and 1.567 to get off the bottom of the screen, no? If its centered you’d have to do some dividing. Then to check top and left you’d need to check for negative positions. Maybe?
Move it off the screen and see what your numbers look like.
oh, does the function only do one point, if so then that doesnt work for me
a solution i thought of is maybe checking if all of the corners are on the screen, but i dont know how to do that
What function, I didn’t give you any function. I’m just trying to give you ideas of how to can check if a gui that you’re putting on the screen, is off the screen or not. None of this makes sense to me, haha.
Okay, but I don’t know what function you’re talking about. A function that someone wrote for you here? You need to make your own function if you want to do this.