Mask in Unity UI like a PRO! (+soft mask) - Unity UI tutorial

Поділитися
Вставка
  • Опубліковано 3 жов 2024

КОМЕНТАРІ • 72

  • @rafateivfik
    @rafateivfik 3 роки тому +28

    This definitely needs more attention. What a great tutorial! The UA-cam algorithm has done good today.

    • @CocoCode
      @CocoCode  3 роки тому +2

      Wow, thanks! 🎉 More Unity UI videos coming soon!

  • @sayamsyed
    @sayamsyed Рік тому +23

    IMPORTANT:
    To those guys whose Git Link isn't working, you need to add .git at the end to fetch the asset properly.

    • @AdamKugler1
      @AdamKugler1 Рік тому

      Legend, thank you!

    • @nilay8641
      @nilay8641 8 місяців тому

      instead downloading git, i downloaded the package from git hub and added the script to package manager

  • @SassyPantsy
    @SassyPantsy Рік тому +2

    IT TOOK ME SO LONG TO FIND YOU
    Thanks!!! CAn't believe unity doesn'thave built in support for this basic feature

    • @CocoCode
      @CocoCode  Рік тому

      Glad to hear that, good luck with your projects! 🌻

  • @PitiITNet
    @PitiITNet 2 роки тому +2

    Woah, that is amazing tutorial! Thank you so much! I had no idea there is mask 2d - I will be using it heavily :D.

  • @entertainmentoverloaded5700
    @entertainmentoverloaded5700 3 роки тому +10

    THe softmask dont work in URP... what to do?

  • @muhammetislambedirbeyoglu3135
    @muhammetislambedirbeyoglu3135 2 роки тому +2

    This video is golden thank you very much for this valuable information :)

  • @Zihenroy
    @Zihenroy 7 місяців тому

    Feels good to learn something new. Thanks.

  • @atomialep
    @atomialep 3 роки тому +2

    Great video mate! Look forward to more

  • @IspyrGameDev
    @IspyrGameDev 7 місяців тому

    Thank you! Short and concise! Perfect.

  • @polking5353
    @polking5353 3 роки тому

    AMAZING, great tutorial now i have a great looking mini map !

  • @stankeyal3390
    @stankeyal3390 3 роки тому +3

    Very good for images. Text Mesh Pro GUI pecomes purple, though.

  • @gamedevGod
    @gamedevGod Рік тому

    Maaaan! You just save me a lot of time! Thank you a lot! Great tutorial

  • @irisdv658
    @irisdv658 2 роки тому +2

    if anyone stumbles upon this : unity's mask component doest take the alpha channel into account now, as long the alpha value is not of exactly 0
    Which is ok because you can't really tell the difference between 0 and 1 alpha value

  • @markbogdan2
    @markbogdan2 3 роки тому +9

    Any reason why all the elements inside this softmask appear purple,as if they are not rendering?

  • @octaviant.2086
    @octaviant.2086 2 роки тому

    Awesome tutorial, helped me a lot with UI.

  • @KavYT
    @KavYT 3 роки тому

    this seems really useful! ill be saving this and subscribing to use these vids later :)

  • @vaibhavkrkm
    @vaibhavkrkm 3 місяці тому

    You remind me of Clear Code YT channel, he makes Godot tutorials (and any other tutorials) in the same pleasurable and relaxing way! 😊

  • @marcdirian6370
    @marcdirian6370 2 роки тому +1

    Hi ! Your tutorial is incredibily clear as the one about animaion ! Never seen so precise explanations before ! Thousand thanks !
    I wanted to use DOTween for my UI animations but still too obscure to me. I'll follow this tutorial and see later on for DOTween.
    Thank's a lot.

  • @suicune2001
    @suicune2001 3 місяці тому

    So cool! Thanks a lot!

  • @Capskiy
    @Capskiy 2 роки тому +1

    Any reason why all the elements inside this softmask appear purple,as if they are not rendering?

  • @unityvictor787
    @unityvictor787 3 роки тому +1

    Nice Tutorial !!

  • @angelrubiov
    @angelrubiov 2 роки тому +3

    Don't forget the .git at the end when using the url!

  • @sparkytherecycledpuppy9400
    @sparkytherecycledpuppy9400 3 роки тому

    Great tutorial, well explained!

    • @CocoCode
      @CocoCode  3 роки тому

      Glad you enjoyed it! Check out other Unity UI tutorials on Coco Code ;)

  • @filopuk
    @filopuk 3 роки тому

    Great, thank you, exactly what I was looking for :)

  • @anjankumardas9738
    @anjankumardas9738 3 роки тому

    Ur Tuts are Unique like you.... 😍

  • @dhanushkad5559
    @dhanushkad5559 3 роки тому

    you saved my life. thanks a lot

  • @Csumbi
    @Csumbi 2 роки тому +2

    why the hell is the soft mask feature not a default feature? Come on Unity...smh...
    great tutorial btw, just what i needed.

  • @antonarcega601
    @antonarcega601 2 роки тому +2

    Followed your steps, but Mask component doesn't have the option to convert it into a SoftMask

  • @MrFarkasOfficial
    @MrFarkasOfficial 3 роки тому +1

    Perfect!

  • @humadi2001
    @humadi2001 Рік тому +1

    SUBSCRIBED!

  • @isaacdart2684
    @isaacdart2684 2 роки тому +4

    TROUBLESHOOT HINT: I was experiencing magenta (pink) coloured masks after applying the softmask, and found out that this is a Unity build issue. To correct it, you can delete your Libraries folder in your Unity project root to force Unity to correctly rebuild all assets (including the softmask shader causing the issue). This may take a few minutes to complete. (I'm using a MacBook Pro under Unity 2020.3.26)

    • @cptwoody7103
      @cptwoody7103 Рік тому

      Did u using custom shader?

    • @jamesthewelsh
      @jamesthewelsh Рік тому +1

      Hmm, before trying this. Please try @gavinjones6264 comment first as it may save you a lot of time if your project is large
      'FOR ANYONE HAVING PROBLEM WITH PINK TEXT: WINDOW > PACKAGE MANAGER > SELECT "UI Soft Mask" > DROP DOWN BUTTON NEXT TO SAMPLES > IMPORT BUTTON NEXT TO "TextMeshPro Support" '

  • @mmmshuddup
    @mmmshuddup 3 роки тому +2

    I came across this trying to make rounded corners on a UI texture2D by adding an alpha mask shader which allows me to set two textures. But this is quite different. Which method is better? Why did this feel so simple but the shader way seemed like a lot? thanks!

  • @umairmunawar132
    @umairmunawar132 2 роки тому +1

    Does it work with URP? I am getting an error in one of the shaders in this package and pink color instead of actual content inside the mask.

  • @serkantarakci1
    @serkantarakci1 3 роки тому

    Thank you!

  • @CrazyKot
    @CrazyKot 2 роки тому

    Hello! Great tutor! Maybe you know, why mask unworking when i used material on my sprite for additive effect!?

  • @egorovsa
    @egorovsa Рік тому

    Thanks!

  • @makeru4024
    @makeru4024 Місяць тому

    are you still giving feedbacks?
    this package actually messed up my text mesh pro texture. it turns every color of text mesh pro texts into black or grey.
    have you encountered this problem? if yes, do you know how to fix it?

  • @AmgedAlfakih
    @AmgedAlfakih 3 роки тому +4

    but it didn't work in URP

  • @BageStudios
    @BageStudios 2 роки тому +1

    I'm getting this error everytime I use soft mask - what can I do about it?
    hader error in 'Hidden/UI/Default (SoftMaskable)': Program 'frag', error X8000: D3D11 Internal Compiler Error: Invalid Bytecode: Incompatible min precision type for operand #1 of opcode #76 (counts are 1-based). Expected int or uint. at line 49 (on metal)
    Compiling Subshader: 0, Pass: Default, Fragment program with SOFTMASK_EDITOR
    Platform defines: SHADER_API_MOBILE UNITY_COLORSPACE_GAMMA UNITY_ENABLE_REFLECTION_BUFFERS UNITY_HARDWARE_TIER3 UNITY_LIGHTMAP_DLDR_ENCODING UNITY_NO_DXT5nm UNITY_NO_RGBM UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2
    Disabled keywords: SHADER_API_GLES30 UNITY_ASTC_NORMALMAP_ENCODING UNITY_ENABLE_DETAIL_NORMALMAP UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_LIGHTMAP_FULL_HDR UNITY_LIGHTMAP_RGBM_ENCODING UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_FULL_STANDARD_SHADER UNITY_PBS_USE_BRDF1 UNITY_PBS_USE_BRDF3 UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_SPECCUBE_BLENDING UNITY_SPECCUBE_BOX_PROJECTION UNITY_UI_ALPHACLIP UNITY_UI_CLIP_RECT UNITY_UNIFIED_SHADER_PRECISION_MODEL UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_VIRTUAL_TEXTURING

  • @carros123
    @carros123 3 роки тому +1

    No se importarlo

  • @lgphy4238
    @lgphy4238 3 роки тому +2

    Question: will this work on iOS and Android devices? Normal masking working in unity but not on mobile builds

  • @knightmake1193
    @knightmake1193 2 роки тому +1

    How do I get the git url? the one in the description doesnt work.

  • @imheretosleep
    @imheretosleep 2 роки тому +1

    Hey guys, I'm wondering if someone can help. I have a UI with some mask on it then after adding urp it won't work, I've changed its material into sprite unlit but it's still the same.

  • @Dragfie
    @Dragfie 3 роки тому

    Hey, was wondering if you knew how to get a rect mask 2D (from a scroll view) to work on objects with their own canvas
    and override sorting?
    or alternatively, how can I have objects in a grid layout within a scrollview change their sort order without re-ordering the layout group and allowing me to mask them all still?
    I can't seem to find any example of how to do this anywhere. Thanks.

  • @ndschan
    @ndschan 3 роки тому +2

    Great video. Can't seem to install via Git link

    • @LeahTynan
      @LeahTynan 3 роки тому +1

      I'm having the same problem.

    • @walmartbiryani5593
      @walmartbiryani5593 3 роки тому +3

      You need to add .git to the end of the URL when pasting. That's what worked for me.

    • @coryefird9355
      @coryefird9355 3 роки тому +1

      @@walmartbiryani5593 That's what i needed. Thanks!

  • @Koreyite
    @Koreyite 2 роки тому

    Softmask doesn't seem to be working. There is no fix icon, and I just get an orange square with a white circle and it does nothing.

  • @gutsberserker5476
    @gutsberserker5476 2 роки тому

    love that boice

  • @yachaleef9288
    @yachaleef9288 Рік тому

    could u show how to import the soft mask into unity from git hub as i am getting some errors

  • @akash_the_phenomenal
    @akash_the_phenomenal Рік тому

    I want to mask UI , but don't want the parent to contain the mask component ,
    that is , I want a mask component on a free object not on parent coz I will be changing the size of parent and this is causing me to change in masking area ,
    What can I do , Please help.
    Sprite mask is perfect , in that I am not forced to attach it to only parent , can't this type of thing done for UI ?

  • @afifyusof7533
    @afifyusof7533 3 роки тому

    help: there are no package manager option in my window tab

  • @MirageDreamer550
    @MirageDreamer550 3 роки тому

    Can somebody tell what to do to make mask shape exactly like image. Because my mask is rectangular like its rect transform.

    • @CocoCode
      @CocoCode  3 роки тому

      Have you watched the second part of the video? ;)

  • @darrylblake9680
    @darrylblake9680 2 роки тому

    Can you create mask that is different shapes? like a star?

    • @darrylblake9680
      @darrylblake9680 2 роки тому

      I guess you don't check the comments - oh well. Still have no idea how to animate a mask. lol

    • @darrylblake9680
      @darrylblake9680 8 місяців тому

      2 years later and I still have no clue. BUT, I do know more details of what I am trying to do. I essentially am trying to do that above. But my gameobjects are using the Layer - gameplay. Where you are using Layer - UI. My sprites also have a Sprite Renderer on them where your's has canvas renderer.
      So with those two details, can I get mask to work? or does it only work with UI?

  • @rotten_inside
    @rotten_inside 2 роки тому

    Great. I am Russian but I forgot all.thx

  • @akmaludddin9281
    @akmaludddin9281 7 місяців тому

    Nice mask tutorial. i know its not the purpose of the content, but. How to SCROLL!?(>:\/)

    • @CocoCode
      @CocoCode  7 місяців тому

      Hi! I see you're binge watching my tutorials - you can find one more about scrolling on my channel!

  • @helenawilsena5821
    @helenawilsena5821 3 роки тому

    Its very useful tutorial.
    Can you please make a UI like Free Fire or PUBG game. Player Selection UI. And Main menu UI where player standing in first scene.