Make Sprites Invisible without Disabling SpriteRenderer and without Masking
Basically, if you take a sprite and change its Mask Interaction setting to "Visible In Mask" you can make the sprite invisible but still functional. I want to use this functionality (i.e. an invisible sprite that is still functional) without using "Mask Interaction" settings, just in case I do end up using a mask in this project at a later date.
What is happening (from a code perspective, preferably) to make the sprites invisible but still functional? Can I do this same thing in a script without manipulating masking settings? Do I need to use a new shader or something?
Thanks for any insights.
Have you tried to set to null
the sprite of the SpriteRenderer ?
Answer by Hassurunous · Mar 22, 2019 at 12:07 AM
I managed to get this working via custom shader, by adding this to the shader:
Stencil
{
Ref 1
Comp Equal
}
$$anonymous$$ake sure this custom shader does not interfere with a masking setup. I believe masking uses the stencil behind the hood.
Answer by Blu3Dragon · Mar 21, 2019 at 11:48 PM
https://answers.unity.com/questions/704935/make-2d-sprites-invisible.html
this link can help you with your problem.
Thank you, but this is not the same issue. I need the sprite renderer component enabled without displaying the sprite. I managed to get it working with a custom shader.
Your answer
Follow this Question
Related Questions
Stencil Buffer not working with SpriteMask 0 Answers
creating a 2d peeling system in unity 0 Answers
Inverse Sprite Maskin 0 Answers
How do i make a character selection menu (2d game) ? 2 Answers
Hexagon shaped sprite 1 Answer