How to make parts of an object only visible when a certain object is on it?

Ver 4.2.2

In my 2d game, I am trying to make a part where you drag a piece of glass onto an object to see things only viewable through the glass. I have no idea how to do this or if it’s possible since I am new to Godot.

You can assign the object in question a CanvasItemMaterial with its light_mode property set to “Light only”.First, select the node you want to hide, then look for the material property in the inspector. Click on the drop-down menu next to it, select “New CanvasItemMaterial”, then click on the entry again to unfold its properties and change the light_mode. The node should no longer be visible now. Next, create a new PointLight2D node and assign it a texture in the inspector. All white areas of the texture will be lit, whereas transparent areas won’t be. If you now move the light on top of your hidden object, it should become visible again where the light hits it.