Scene/Game view strange behaviour

Hey there,

I am just getting to grips with 2D development in Unity and have came accross something I do not understand.

As you can see in the above screenshot, I have 4 sprites. There are two white rectangular backgrounds, and 2 green ground blocks.

The Y/Z coordinates of those 4 items are all set to 0. The only different coordinate is (as you can imagine) the X coordinate.

So I do not understand why the game view is showing one of the ground blocks to be behind one of the white backgrounds.

Any ideas?

For 2D development if you are using sprite renderer then there is a property in inspector “Order In Layer”. You have to set this according to what object you want in front and what in back. Lesser will be the value of “Order In Layer” that sprite will be rendered first and higher thet value of “Order In Layer” that sprite will be rendered at last. You can better understand by this scripting reference:
link text