Unity 2D depth error

Greetings all.

I seem to be a bit lost in unity’s new 2D interface. I am currently making a sample game to learn how to use the new 2D features.

Basically I have a scene comprised of sprites. Terrain sprites and a character sprite each inside a specific layer.

My problem comes when I try to add a plane to the scene. The planes are needed to bring a parallax effect into the environment, but for some reason their materials render behind the sprites no matter what I do to their z position.

This seems to only happen when I use a material with alpha value.

Any help would be greatly appreciated. Thank you.

Is there something in my preferences I need to adjust.

You don’t need a plane, just use another sprite.

–Eric

I can’t adjust the texture offset via script.

You can just place multiple sprites, they get batched so it won’t cause a performance issue. Or are you trying to make an endless runner? If so, then you need to edit the Sprite shader code, switching “ZWrite” to “On”, then it should respect z-distance.

Thanks for the suggestion Invertex.