How can I let a GUI appear or disappear if it goes through another GUI?

So, I recently saw some games where there is a Gui which comes out of another Gui or disappear if it goes through the GUI. How is this possible?

I tried to make an example about what I mean:
example

Here is another example from a game called “Mall Tycoon”. These coins go through the gap, but how it’s possible that they disappear. I mean the gap isn’t big enough, so they can disappear if they are behind them (the blue thing with the face on it is transparent).

2 Likes

Found the solution: GuiObject.ClipsDescendants (roblox.com)

Use clipping so when it goes past a certain point, it clips under it.