我为我的玩家角色创建了一个精灵,并想为该精灵添加一个幽灵效果。我只是想制作一个透明版本的角色。问题是我将我的播放器图形分成不同的部分以使动画更容易,所以当我只是简单地增加每个精灵的透明度时,您显然可以完整地看到所有精灵。
我只是想让播放器(大黑盒子)“身体”后面的所有像素完全透明。知道我将如何实现这一目标吗?
感谢任何能提供帮助的人!:)
我为我的玩家角色创建了一个精灵,并想为该精灵添加一个幽灵效果。我只是想制作一个透明版本的角色。问题是我将我的播放器图形分成不同的部分以使动画更容易,所以当我只是简单地增加每个精灵的透明度时,您显然可以完整地看到所有精灵。
我只是想让播放器(大黑盒子)“身体”后面的所有像素完全透明。知道我将如何实现这一目标吗?
感谢任何能提供帮助的人!:)
Looks like I didn't know about Sprite Masks. Basically I just had to add a sprite mask to the player prefab and use the body sprite as the mask. Then I simply mark all of the "Mask Interaction" fields as "Visible Outside the Mask" for all objects displayed behind the body.
Here is unitys docs on it and here is what is looks like https://docs.unity3d.com/Manual/class-SpriteMask.html