Show outline (effect) of object, while object itself is hidden

When my player sprite is obstructed by an object, I would want to show an outline of it.

I tried to spawn a duplicate of my player sprite on a layer atop of all other objects (“outline” layer) and I added an outline effect to this layer. To avoid the full player sprite always showing on top of everything, I tried to hide the player sprite and also tried to set its opacity to 0. But when the player sprite is hidden in that way then also the outline is not shown.

Is there a way to hide an object itself, but still have it’s (layer) effects be visible?

This will be hacky as hell

1 - with ADJUSTMENT effect you can make your object totally white or black
So that is how you won’t need to re draw your player you will only need to make duplicate of your player object
SO you can do this

2 - there is sprite/object masking extension
It allows you to see trough other objects
White color makes something visible and black hides it

PLAY WITH MASKING like try it
I never can remember how to properly use it
BUT after few mins of trail and error i have 100% understanding to what to do to achieve what i want

NOW you would want to do is
Have outline on your player
DON’T have outline on duplicate of player
Have Player and Player2 on same layer
Have this running without any condition
ACTION change Player2 z order set to Player.ZOrder()+1
And deduce what color needs to be Player2 to see trough Player
So you can make Player sprite invisible but keep his outline

I AM WARNING YOU i really have bad time remembering how object masking should be used
It is ultra easy to deduce what will happen if you mask something with white or black
BUT still i could mix up something in my description above cause of that
I am more than sure it will work and it is doable this way
All you need to do is trail and error it

Actually now that i think about it
I would try making Player2 white and use him as mask
And apply outline to it to check if that would work

TRAIL AND ERROR is your best friend here

Thank you! I will try this.

I played around with the masking for another feature and had the same experience as you. I felt it was not intuitive but after a few attempts I got it to work.

2 Likes