[ZED Mini][Unity] How to toggle depth occlusion at runtime?

Hi,

I’m currently working on a project where the user can switch between AR and VR. Therefore, I would like to toggle the depth occlusion at runtime. If I click on the “Depth Occlusion” in the inspector while the application is running it works fine. However when I call _zedManager.depthOcclusion = true/false, nothing happens. The “Depth Occlusion” in the inspector does get ticked/unticked correctly. So somehow there is a difference between clicking the inspector and changing the value via code. Digging into the SDK Code did not reveal anything for me.

Can somebody help me?
Thanks!

Okay nevermind…
Just found the “OnValidate” method of the ZedManager Inspector. This led me to call zedRenderingPlane.ManageKeywordPipe(!_zedManager.depthOcclusion, "NO_DEPTH"); on both RenderingPlanes immediately after changing the depthOcclusion at runtime.

1 Like