Question by 
               Rapeseed_Oil · Sep 29, 2021 at 02:53 PM · 
                shadersprite2d gamesprites2d sprites  
              
 
              How do I outline sprites hidden behind another sprite?
I would like to reveal sprites that are hidden behind other sprites in the sort order by making a coloured outline around them that appears in front. The screenshot of Age of Empires 2 below shows the effect I'm going for: where the horsemen sprites hidden behind tree sprites have a red outline. (And the parts of the sprite that aren't hidden don't have the outline!) I've tried applying a "Sprite Outline" shader but that just made the sprite invisible except for the outline and sent it to the back of the sort order. 
How can I achieve this effect?
 
                 
                outlined-horses.jpg 
                (293.7 kB) 
               
 
              
               Comment
              
 
               
              Your answer