Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

How do I move a mask without moving the children ?

Discussion in '2D' started by unity_IQ9s28nZcZvGJQ, Aug 2, 2021.

  1. unity_IQ9s28nZcZvGJQ

    unity_IQ9s28nZcZvGJQ

    Joined:
    Jul 25, 2021
    Posts:
    4
    This might be a stupid question but I have no idea how to do that because the mask has to be a parent of what I want to mask but that also means that I can't move it without affecting the sprite...
    I'm trying to use it for a UI.
     
  2. TheNightglow

    TheNightglow

    Joined:
    Oct 1, 2018
    Posts:
    201
    Why does the mask has to be a parent of the masked object?
    What would go wrong if it wasnt?
     
  3. unity_IQ9s28nZcZvGJQ

    unity_IQ9s28nZcZvGJQ

    Joined:
    Jul 25, 2021
    Posts:
    4
    All the tutorials I've seen say it has to be a parent, and nothing happens when it's not a parent.
     
  4. TheNightglow

    TheNightglow

    Joined:
    Oct 1, 2018
    Posts:
    201
    Oh, sry, I thought you were talking about SpriteMask (2D masks that dont need to be placed in a UI canvas (but technically still can be used in UI)), and not Mask (a UI element)

    there is a seperate part of the forum for UI specific questions here:
    https://forum.unity.com/forums/ui-toolkit.178/
     
  5. unity_IQ9s28nZcZvGJQ

    unity_IQ9s28nZcZvGJQ

    Joined:
    Jul 25, 2021
    Posts:
    4
    Oh sorry about that, I'll go ask there instead