Clip scene contents without using Control node?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By i_love_godot

Godot 3.2 BETA 4


I’m creating a sliding door for a maze. I want to be able to raise/lower the door without it spilling into the surrounding parts of the maze since the maze walls are quite thin. A little searching shows that Control nodes have the ability to clip content to their rect, but controls are drawn above other elements. I need my door to be behind other elements on the tilemap.

Is there a way of doing this with a regular node that I can position in the scene tree as needed. The door itself will be an Area2D to detect collisions when the door isn’t open. Therefore the “invisible” part of the door would need to be unreactive to any collisions and not just transparent.

Any ideas would be appreciated. Thanks :slight_smile:

:bust_in_silhouette: Reply From: Michel Mattos

You can put your Control node inside of Node2D. Then you can use the Control ability to clip content (your Area2D) and the Node2D to control its Z index (or just move it below your wall nodes in scene to put it behind).