/*add by HanSyaun for showing code on article. start*/ /*add by HanSyaun for showing code on article. end*/

2018年3月4日 星期日

Unity 2017.2 canvas and object sorting problem

Just found out some weird result with my Unity project. I place a cube in front of  a UI image, which parent under a canvas and the canvas render mode is set to "screen space -camera".
On the editor it looks alright. But after I build it into an APK, the cube is behind the UI image.

The problem is because "depth and stencil buffer" is disabled in player setting. I kind of know about depth and stencil buffer but never thought about changing this setting will affect the sorting result of UI and Object. Hope this message helps anyone who bump into same issue.




沒有留言:

張貼留言