How to detect overlap area of 2D sprites?

Hi. I’m pretty new to unity, and I’m trying to make a simple 2d cleaning simulator, that has different shape cleaning tools following the mouse pointer, and when you click, it cleans the 2d sprite where the sprites overlap.

I have a collider on my “floor” area, and I am able to detect mouse clicks within the collider. I’ve looked everywhere online, and can’t seem to find a way to get the area of the overlap between the two sprite layers, and then either remove or add something at the overlap area (i.e., either clean the dirt or add soap, etc). Does anyone know a way to get the area of the overlap, either partial or full?

I dunno about cleaning or overlap, but I accomplished this “cleaning” effect with RenderTextures here:

Full source here: How to make scracthcard? [2D]

3 Likes

Thanks! Not sure if that’s going to work entirely, but it’s definitely a good starting point!