[SOLVED] Layers don't appear to work on PlayCanvas


Doesn’t seem to have any effect when using it in PlayCanvas editor.

new pc.LayerComposition();

I get error: TypeError: pc.LayerComposition is not a constructor

The typehinting does show it as a valid reference in the scripting editor!

I want to hook some onPreCull on the main world layer to run my own culling changes based off camera.frustum, prior to PlayCanvas’s default camera frustum culling operation. But no luck. Seems like all the layer functions aren’t working.

Whoops. It looks like the process that builds the API reference manual used the master branch of the engine repo on GitHub. It should have been using stable instead. I’ve regenerated them from stable, so the Layer related API is now gone again.

I suspect the new layer system will be deployed to production next week. Sorry for the confusion!

1 Like