- Home /
GameObject with SpriteRenderer either on top of everything or not showing
Hi.
I have a Canvas and two Panels in it.
The first Panel is the GamePanel, and in it is a GameObject with the SpriteRenderer called CardPile. The second Panel is the DeckPanel with some buttons, text etc.
When I created the GamePanel and the CardPile object, the CardPile was not visible until I changed the Render mode in the Canvas to Screen Space - Camera (Main Camera), and the sorting layer of the CardPile to Default 1.
The Canvas and everything inside is in the Default layer.
Then I created the DeckPanel, with the buttons etc, and made it active, and everything is fine, except, the DeckPile is always on top.
So, I played with the camera modes, canvas modes, sorting layers etc, but nothing works.
As you can see, the GamePanel is under the DeckPanel, but the CardPile is still on top of everything, even though it is the child object of the GamePanel. So, my question is, how do i make the CardPile be visible on the GamePanel,but not on the DeckPanel also?
Thank you in advance :).