Static highlight layer is not enabling / disabling from an event

I have two static highlight layers both of them contain meshes, what I’m trying to do is turn off one and activate the others and vice versa:

        static layer1: BABYLON.HighlightLayer;
        static layer2: BABYLON.HighlightLayer;
        myClass.layer1 = new BABYLON.HighlightLayer("", this.scene);
        myClass.layer2 = new BABYLON.HighlightLayer("", this.scene);
        myClass.layer2.isEnabled = false;

///Another script:
    myClass.layer1.isEnabled = false;
    myClass.layer2.isEnabled = true; 

I would put this on the playground but it’s using the Unity toolkit, and I don’t think it’s specific to the playground.

When I call the enabled from another script it’s not enabling / disabling. I’m not getting any errors and the layers stay exactly the same.

Pinging @sebavan

I do think it is not supported at all at the moment and would probably creates conflict on the stencil, let me have a look ASAP.

Thank you so much!

PR is up, this will be in the next nightly: Fix Highlight layer enable state by sebavan · Pull Request #6781 · BabylonJS/Babylon.js · GitHub

1 Like

This is such a great community, thanks so much guys!