Fade not working for new versions of PC

I made a project a while ago following this same logic for fading. But for some reason it doesn’t work now!

Not sure the case, but here is the code, is there an updated way to handle this that I’m missing?

var FadeBlankScreen = pc.createScript('fadeBlankScreen');

FadeBlankScreen.prototype.initialize = function() {
    
    this.timer = 0;
    this.fadeOut = 0.999;
    this.fadeSpeed = 0.3;
    
};

FadeBlankScreen.prototype.update = function(dt) {
    
    this.timer = this.timer + dt * this.fadeSpeed;
    var meshInstances = this.entity.model.meshInstances;
    var alpha = this.fadeOut - this.timer; //I've also tried lerping and same problem. 
   
// the time to fade 
    meshInstances[0].material.setParameter("material_opacity", alpha);
    meshInstances[0].material.update(); //I also tried leaving this line of code out and still doesn't work. 
    
    console.log(alpha);
   
//Destroy after fade is done. 
    if(this.timer >= 1.1){
        this.entity.destroy();
    }
    
};

Do you have a link to the project? Is the material setup to be alpha’ed?

I made a new one to demonstrate the problem. Made it simpler but same principle.

The intensity is going from 0.999 to 0 and when it hits 0 it destroys the entity. But between that time the opacity should change right?

https://playcanvas.com/project/586549/overview/questions