[SOLVED] Is there an example of a layerList?

I see it in the API but there is no code to explain the concept.

Thanks

Hi @groupsjrBrianDouglas,

You can check any PlayCanvas on how the engine spawns a layer composition to render the default layer list that includes the World, UI, Depth etc layers.

The LayerComposition class can be found in the following object:

this.app.scene.layers

And here is a simple engine example that showcases how different layers can be used:

https://playcanvas.github.io/#/graphics/layers

Does this apply to the models themselves? I am finally bale to be a bit more specific. I am triggering a build animation that then has a bool that gets set on the animGraph to a looping anim. The issue is that the loop is not syncing with the build, it gets rotated some. I can figure it out for the life of me.

Hmm, layers are responsible for ordering mesh instances when rendering them. Not sure if it’s related to your issue.

Try posting some info and if possible a demo project that reproduces it.

https://playcanvas.com/project/860286/overview/synctest-public

I am now thinking that perhaps to get around this, I have to use a version of the legacy animation that I can write that will behave like a psudo state graph. I can then grab the current time when it closes and if played again triggger it to start at the last position.

Are you talking about animation layers rather than render layers?

Nevermind. I solved it. I just used some example someone else built and was able to capture the time when an animation ended and then when replayed pick up from where it left off, works like a charm. Look forward to sharing the AR project when we launch it. Thanks for the help on all my multitude of questions.

Here is the solve. Use the 1 button to trigger the intro animation and the 2 button to start the loop. After that wait a few seconds, use the one button to trigger the intro again and then start the loop with 2.

https://playcanvas.com/project/859945/overview/synctest

1 Like