I have my character standing with his left side to the camera next to a fridge. He opens it with his left hand, while with the right hand, he reaches inside and takes out some food. The fridge door is not part of the animation; it is a scene object. I created a mask over the fridge door, and I would like this mask to be applied to the right hand so it looks like the character is reaching inside the fridge.
I have a similar animation with reaching into a drawer for a book, only the character is now standing with his right facing the camera and uses the oposite hand to reach in the drawer. And here comes the problem, because the mask is affecting both hands equally. I need to somehow set that the mask will affect the right hand only for one animation and the left hand only for the other. Here is what i tried:
At this point, I ran out of ideas. Could anyone please help?
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
This is a general Unity topic - the use of SUC isn't a factor here.
Do you have a Sorting Group on the root? So long as only the arm you wish to mask has its Mask Interaction field set to Visible Outside Mask, and all others set to None, then only that sprite should be affected by any Sprite Mask object.
This Mask object should also be a part of the Hierarchy (i.e its parent is the object with the same Sorting Group as the other sprites), but other than that no Custom Range option should be necessary.
The problem is that i want the same arm to be Visible Outside Mask during one animation and have interaction set to None during another. And I cannot figure out how to make the change during gameplay.
Through script:
Attach to the arm sprite and use the Object: Call event Action to trigger either of the two functions on it.
Thanks, Chris. But for some reason, it doesn't work, and after running, the fields are empty.
However, I came up with a different solution. I made a child copy of every sprite with a mask interaction set. Then, I just turn on/off the sprite renderers of the parent or the child as part of the animation.