How to do inverted UI masking in Unity
Вставка
- Опубліковано 19 тра 2022
- The UI "Mask" component in Unity doesn't allow to do reverse masking, but fear not, there's a simple solution.
Check out our steam page: store.steampowered.com/app/16...
Credits to Glitchers where it's due: answers.unity.com/questions/1... - Навчання та стиль
For those who want the mask to move and the background not to move:
Set different Materials to the mask and the bg
Mask:8,1,2,255,255,0;
BG:3,2,0,0,1,15;
Then you can just put the Mask and BG the child of the canvas, and the mask needs to be upper
Finally, you can move the mask now
wow thx :)
the tutorial didnt work for me put changing to this actualöly did it, so thanks!
thanks, very useful
Wow this is so much simpler than I thought, you'd think Unity would just provide these materials by default. Thanks!
This is excellently simple and useful!
Such a great way of doing tricky things.
Thanks a lot!
My man, just wanna let you know you are a LIFE SAVER. I've been like 4 hours or even more on this, because when I loaded new scenes through doors in my game, the other methods (with scripts to create new stencil materials) just broke and didn't create the black masked material for some unknown reason. I've been searching this whole time and, after a short break, picked up your video. Thanks!
I was looking for this. Great tutorial. Thanks!
Quite an awesome vid, it was exactly what I was looking for. Thanks a lot for sharing!
Thank you very much! I've been looking for this all day!
Thanks you so much! I needed to do normal masking, but without parenting so that I could anchor to the correct element, and this finally did the trick!
Thanks mate, just what I was looking for!
Thank you very much for the lesson, great video! I wish you success with your project :)
Thanks a ton for this video, spent a few hours looking for this solution and luckily I stubled upon this!
Awesome tutorial! This is really useful!
This was super helpful, thank you.
Great solution! Thank you
Wow I was looking for a method that works. Thanks for the info
Glad I could help
invert masking is what I need guys and dudes, thanks.
It actually freaking worked, thanks a lot
Hey man thanks alot! Also for anyone that want's the reverse effect, I changed stencil id on masked material to 1 (so both materials have same id) and it worked
고맙 :)
Thank you for this, exactly what I needed!
One question though, how do you make the edges smooth?
Answering my own question - on the image component of the mask, click Color and set alpha to 1.
Thanks, this just magically worked. You are awesome :)
Glad I could be of assistance :-)
thank you guy, it is awesome
Thank you! rly helpd me
I’m glad I could help :-)
Thank you so much man!!!!!
Thank you!
Do not set the alpha channel to 0 in the UiMask material settings and everything will work for those who do not
Thank you
Nice video bro.
Glad you like it :-)
Awesome!
Thanks for the tutorial, I think inverted UI mask should be available in unity built-in components
Works Thanks
TYSM
If you followed but doens't work. try "Ctrl+R" (reload asset) in unity.
i spent hours because of this lol. after reload asset work well! thx for vid
thank!
Not Work ㅠㅠ
How can i make mask looks more smooth? On video it has sharp edges and pixels. Thanks for the video btw.
Use mask material tint color alpha 1
this doesn't work in Unity 2020.3.40f1
I honestly don't see why it wouldn't. Can you say exactly what doesn't work for you ?