We’re having some issues with drawing order with the Spine Plugin, where moving/rotating the camera causes various elements to reorder themselves incorrectly.
After a lot of investigating I tried out the Spine Plugin example project and noticed that there are no issues at all in the published version - Spine Plugin - PLAYCANVAS
But running the scene through the editor in this project has the same draw order issues we’re encountering (once you move the camera) - PlayCanvas | HTML5 Game Engine
Hi, we have recently deployed our new Layer system which changes the way things are ordered. We did not update the spine example I’ll do that right now and share it with you shortly.
The spine.js script now has a script attribute called Layer which is the name of the layer that you want to add your Spine characters to. I created a new Spine Layer and made both its opaque and transparent sort modes Manual. This means that their draw order will now be controlled by their priority instead of their depth. I assigned the Spine layer to the spine script of the characters.
Add your new Layer to the sublayer list below - you can put the opaque sublayer after World Opaque and and the transparent sublayer after World Transparent
Use the new spine.js script and pass the name of your new layer to the Layer script attribute.
Thanks for the detailed description on how to use the layers, vaios!
One thing that made me struggle a bit though: you haven’t updated the actual script “spine.js” (the one in the ‘src/script’ folder on Github) to include the Layers attribute on a Spine object in Playcanvas, so I had to take the one from your demo to make it work.
This is a very helpful discussion - I had some weirdness with Spine layering over a 2D element. I can confirm that the ‘layer’ attribute discussed in this thread is not present in the playcanvas-spine repo; I had to pull spine.js from the demo also (https://playcanvas.com/editor/scene/605386) - this thread could use an official update to clear things up.
I should add, simply swapping out my spine.js to the demo one fixed my issue