Search Unity

"Unlocked" Sprite mask that that does not move with the overlying sprite?

Discussion in '2D' started by ShrikeDev, Nov 14, 2022.

  1. ShrikeDev

    ShrikeDev

    Joined:
    May 31, 2018
    Posts:
    31
    Kind of like in photoshop when the clipping mask is not linked to the layer it's clipping to. To give you an idea, my character has an idle animation in the main menu, I want the tiny stars on her weapons to be attached to the background so that they do not move together with the weapons in the idle animation. At the moment they're just static sprites attached to the weapons themselves. Only the bigger stars should move with the weapons. Is this possible with sprite masks or can I use something else? When trying out a sprite mask it attaches to the weapons and I haven't found a way to unlock it. I'm using URP 15.0.1 Unity version 2023.1.0a18

    80d94d3ff84c97904c2c90d07337a582.png
     
    Last edited: Nov 14, 2022
  2. ShrikeDev

    ShrikeDev

    Joined:
    May 31, 2018
    Posts:
    31
    Think I made it work, made two separate gameobjects, one containing the sprite mask and one containing the sprite renderer. Didn't occur to me that the mask and the renderer can be on separate objects.
     
  3. ShrikeDev

    ShrikeDev

    Joined:
    May 31, 2018
    Posts:
    31
    don't think it works still, it's not preserving the transparency of the sword. do i need to do it with a material maybe?
     

    Attached Files:

  4. ShrikeDev

    ShrikeDev

    Joined:
    May 31, 2018
    Posts:
    31
    got it to work, put the sprite mask on its own gameobject and attached it to the bones, but probably not the best way