Tilemap renderer as a mask

Hello. Is it possible to use tilemap as a mask? Say I have a particle effect and want it to be visible only behind tiles.

1 Like

you can always try, but it sounds like it should. if mask component doesnt work, try spritemask

As indicated by name, sprite mask takes a sprite as mask shape. I need to use tilemap as mask shape instead.

You can create a sprite mask prefab with the same size as your tiles in tilemap.
If your tilemap is rect, simply instantiate your mask prefab and scale it up to cover your tilemap bounds and move it to the correct position to mask your whole tilemap.
Else instantiate separate prefabs per each tile in your tilemap.
Obviously using the first approach has more performance.
There should be a way to inherit from spritemask and pass tilemap renderer but I’m not sure about that.

I’m working on qix/volfied clone project. I navigate my player on tilemap and generate new paths as tilemap cells.
My question is can i use tilemapcells to mask graphics like in volfied.

Is it possible to mask sprites with using sprite mask and tilemap.
Is there any solution on using tilemap as a mask?

no, maybe with a shader but thats a lot of work