Enable and disable entities with a button

Hi @saif I can’t get the code highlighter option to work, sorry
I am trying to understand the tutorial that you have recommended, but I can’t seem to combine what you explain to me and what the tutorial teaches, I am frustrated.

,

//

var EventReceiver = pc.createScript(‘changeLayouts’);

EventReceiver.prototype.initialize = function() {

this.layoutABtn= this.app.root.findByName(“Layout A”);

this.entityToDisable = this.app.root.findByName(“entityToDisable”);

this.layoutABtn.element.on(‘mouseup’, this.onLayoutABtnPressed, this);

};

EventReceiver.prototype.onLayoutABtnPressed= function() {
this.Layout A_One Box.enabled = false;
};

,