0
votes

I'm trying to animate a face using Anima2D for rigging. Anima2D generates Sprite meshes for sprites that would be rigged and animated.

My problem is that I need to hide the tongue and teeth inside the mouth, and for that I was using sprite masks which are static and don't deform.

Is there a way to use sprite meshes as sprite masks? Or is there any other solution that I can use?

The image is an example of what's happening when I move the mouth (which uses sprite mesh). As the sprite mask (marked in orange) don't deform, the teeth and tongue bypass the mouth.

enter image description here

PS: I've found about stencils, but I don't think they would work since I need to hide sprites inside sprite mesh (not normal sprites).

1

1 Answers

-2
votes

In general, you would just need to change your "mask interaction" setting on the SpriteRenderer component on your tongue and teeth gameobjects and play around with the "Order in Layer" or "Sorting Layer" on these objects as well. Here's a quick example of what I quickly put together. Note the highlighted area:

Sprite Mask Location in Inspector