Hiding GUI in dual cameras scenes from second camera

Is there a layerMask option for GUI elements?
In this Playground, I am trying to hide the TextBlock in the corner camera.

there’s no layerMask option for GUI but you can use utilityLayers to do so.

var utilLayer = new BABYLON.UtilityLayerRenderer(scene);
utilLayer.setRenderCamera(camera);

var advancedTexture = BABYLON.GUI.AdvancedDynamicTexture.CreateFullscreenUI('UI', undefined, utilLayer.utilityLayerScene);
2 Likes

That’s great, thanks!

1 Like