0

I am making an 2D Multiplayer Shooter with usage of Anima2D skeletal characters, also I am using an layer masking, so player can see enemies only in choosen radius. My problem is, I can not set mask interaction on mesh(Anima2D characters are built from sprite meshes).

enter image description here

At the moment I am using stencil shader material and it is working, but I want to set one more material for character later(light material). Anima does not let me put material size to 2.

Is there any way to set more than one material to Anima2D character, or set any mask interaction on parts.

Another question is: Is there a way to give material for a Anima2D character as a whole? I want to use "dissolve" effect whenever a player dies, but i want it to affect whole character, not each part of it.

I did spend couple of days trying to solve this, but im still a newbie when it comes about Unity and it makes it hard.

enter image description here

TL;DR i Just want to remove my stencil buffer material from character, and control visiblity by layer masking.

Kiket95
  • 73
  • 10

1 Answers1

0

You need to assign your material to SpriteMeshInstance Material slot. Don't even touch that renderer, it overwrites it's material every frame.

As for masking, standard Unity's SpriteMask works with Anima2D's example shader Anima2D/Examples/Shaders/VisibleInsideMask. Just assign that material to SpriteMeshInstance Material slot, and it will be masked along with simple sprites.

Such pity, nobody wrote this solution here. Would saved me hours of desperate tries to figure this out.

Source of this solution you can find on one of last pages of this thread

zORg Alex
  • 372
  • 2
  • 15