Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Sprite mask and sorting group issue

Discussion in '2D' started by Quentin0133, Sep 15, 2022.

  1. Quentin0133

    Quentin0133

    Joined:
    Dec 20, 2018
    Posts:
    1
    Hello,
    I'm having an issue with the sprite mask and the sorting group.
    I have a character having a sorting group with an external sprite mask :
    upload_2022-9-15_11-34-19.png
    So the character can be seen behind the obstacle, I want to do the same with the weapons that the character can wear :
    upload_2022-9-15_11-40-12.png
    Weapon hierarchy (He has a Sprite mask that doesn't work)

    And that's where the problem lies, I want to sort my character with the weapon, I need to instantiate in the sorting group :
    upload_2022-9-15_11-40-48.png
    The full hierarchy in game

    If I don't mask for the weapon :
    upload_2022-9-15_11-37-43.png
    The weapons of the character are spawned, so I can't make an external mask and he has multiple type of
    weapon so the size can depend.
    I am open to the solution and would like to discuss it.

    Unity version : 2021.3.8f1

    Thank you in advance
     

    Attached Files:

    Last edited: Sep 28, 2022