Create circular "hole" to reveal TileMapLayer below another TileMapLayer

Godot Version

4.3

Question

This is a weird one, but it’ll make an effect that I think is pretty necessary to my game. I currently have two TileMapLayers stacked on each other for my floor terrain in my game: one that reflects one state of the world, another that reflects another state. I have another node in the scene that creates a circular area that expands and contracts. I want to make a hole through that first TileMapLayer to expose the one underneath to view both layers at the same time by using the radius of the circular area node.

I tried using a shader, but TileMapLayer has some weird coordinates stuff that I couldn’t figure out how to map correctly with a shader (I’m horrendous with shader languages, so that might still be an option that I just didn’t get right). I also tried using different light layers to create a mask, but every light texture is kind of just a glorified square, so it doesn’t make the circular effect I want. I tried clipping with canvas layers, but that didn’t seem to get me anywhere either. If anyone can possibly help, that would be greatly appreciated. Thank you!

What you are trying to do is called a clip mask. If you Google you will find dozeons of examples. Most rely on a Light2D which sounds like you already tried. Use a texture with a circle and it won’t be square anymore. Here is a video: https://www.youtube.com/watch?v=W4j4tnQLcTA

Thank you! For some reason when I was working on this before, the clip didn’t show up at all, must’ve had my nodes set up wrong. Makes a lot more sense now.