Not sure this is Intended or Bug.
example, i have a Text Object ( which can be click. ), in LAYER 6
in some condition, LAYER 6 was invisible, so The Text Object was invisible too.
but, it still functions.
you should add a condition that if the layer 6 visible-> you can interact with it. If NOT, stop interacting.
Develop games in your browser. Powerful, performant & highly capable.
ya. current add mode condition on those "mouse click" event..
you can put a sub-condition to check this before do an action.