Layer#onPostRender has been removed

Since upgrading to v2 of the engine I get the error:
Layer#onPostRender has been removed.

I think the line in my code is:
this.countLayer.onPostRender = this.onCountLayerPostRender.bind(this);

It seems that because of this error the function onCountLayerPostRender is no longer run. Any idea how to resolve? This worked fine before the upgrade and I cant see any notes about this kind of thing in the migration docs.
Thanks

(Also CC @mvaligursky on potential migration notes update?)

1 Like

Okay cheers. I tried the following event but I just get the error EVENT_POSTRENDER_LAYER is not defined :


this.app.scene.on(EVENT_POSTRENDER_LAYER,(camera,layer,transparent)=>{
        this.onCountLayerPostRender.bind(this);
    });

You need to use the global pc ‘namespace’. ie pc.EVENT_POSTRENDER_LAYER

1 Like

Perfect. Thanks!!

just checked, and it’s there: Engine Migrations | PlayCanvas Developer Site