Search Unity

Multiple masks affecting a single sprite

Discussion in '2D' started by CrowbarSka, Jan 11, 2020.

  1. CrowbarSka

    CrowbarSka

    Joined:
    Dec 15, 2009
    Posts:
    192
    Hello! I'm looking for a simple way for multiple Sprite Masks to affect a single sprite (ideally just using the basic SpriteMask component).

    From what I can see, sprites can only use one mask at a time. Does anyone know another way? I've tried stacking multiple masks but that doesn't seem to work.

    The effect I'm trying to achieve is a large tiling texture border covering the screen, with a rectangular hole cut out of the middle. Then *all* of this image should be hidden, except for a circle that's centred around the player.

    The result should be that this large tiling rectangular level border should be visible only when the player moves near it, like this:



    The problem I have with my current setup is that the hazard stripe edges are made of multiple sprites, and there are visible seams and tiling issues. My level size has to be a particular, irregular weird size which is difficult to tile cleanly, and I can't change that.

    Any help appreciated!
     
    Last edited: Jan 11, 2020
    graybear209 likes this.
  2. Pyrian

    Pyrian

    Joined:
    Mar 27, 2014
    Posts:
    301
    Wait - how are you planning on using multiple masks to fix your tiling problem?