Intersecting sprites
I've got a pretty specific problem, and I figured asking would be easier than trying to fry my brain with it
Basically, my characters/walls are made out of two sprites: a front sprite and a top sprite
The front sprite, if you were, would be the sprite you see in a platformer, while the top sprite is what you would see in a game with a top-down perspective
My problem is with how Unity renders sprites vs how I want to render the sprites (and there's probably a way to render it the way I need/want)
I'll illustrate: This is how I need my sprites to be rendered:
And this is how Unity renders them:
As you might see, there isn't really a problem when you're looking from the top/front, but an issue does arise when you're looking from any other angle between those two - which is an issue for me, since I'm making an isometric game.
I'd just like a hint on if there's a way to do intersecting sprites, be it through a 3D flat model or through another way
Any help is very much appreciated.
This is related to the shader you use, sprite and particle shaders by design behave lije this to save framerate. Otherwise try other shaders like Unlit/Transparent/Texture.
Thanks a lot! This wasn't the exact solution I used, but it did point me in the right direction to solve my problem.
I just used a Standard material set to Cutout, which the sprites are going to use
Answer by Jopaco1 · Oct 13, 2021 at 07:15 PM
I had this same issue in my own project and I solved it by creating a custom shader and material using Shader Graph. Changing the Surface setting to opaque made the sprites render how they should. The rest of what I did was basically mimicking the default sprite renderer. Attached is a screenshot of the final shader.
Your answer
Follow this Question
Related Questions
Blending tiles with larger textures 0 Answers
How to continue material between sprites. 1 Answer
Image not rendering with script attached 1 Answer