A object closer to camera than B object, but A object is behind B and is not visible
I have a canvas inside a canvas and it's called a tablet and a panel for taskbar function I want to assign wifi or battery symbols on it but although the z-axis of the panel to see those symbols is farther from the camera, the panel still stands on the symbols and the symbols are not visible. What should I do? Please help me :(
z-axis of symbols is -2 z-axis of Panel is 0 Camera Z-axis is -1000
and when i change Camera Z-axis to 1000 i still see Clock and Panel in Game tab why ?
Screenshots that I think will be useful to you maybe to help me :
Answer by ryanmillerca · Nov 23, 2020 at 01:39 PM
I see you're mixing Image components with Sprite components. You should work in a Canvas with only Images (and other UI components) OR outside a Canvas with all sprites. Mixing the two will cause the sort of issues you're describing here.
Canvases don't sort with Z-depth, they sort with Hierarchy order (sibling index). Change your Image game object's order under the parent group to modify the draw order.
If you want to stick with using Sprites, you should use sorting layers https://docs.unity3d.com/Manual/2DSorting.html