• Runtimes
  • Spine import animation and Unity layers

Hi,

I search a solution for my Unity project.
I've made a scene with Unity sprite (4.3) and it use the layer depth to organize all the sprites.
I've imported a Spine animation, but I don't find how to place it to the good level of layers.
As default, it appears on background.
Does anyone can help me to find a solution ?

Thanks
Loryanne
Tataragne Interactive

Related Discussions
...

I'm afraid I don't know unity well enough to answer that question. Maybe one of the resident Unity users can chip in? It's possible Nate will know how to do it, but he is swamped at the moment so it might be some time before he can reply.

Thanks Shiu.
We found a solution, but not THE solution !
We change the shader for unlit shader. But ultimately, we'll need to apply a lit shader to play with light in our sccene.
Hope someone can find a real solution !

If you're talking about the new Sprite system and Sorting Layers, you can set the sorting layer of any renderer via script.

http://docs.unity3d.com/Documentation/S ... derer.html

In particular you're interested in:
sortingLayerName
sortingLayerID
sortingOrder

I've not had to use these myself yet, so I can't give anything more specific re Spine compatibility, but it should work as with any other renderer (i.e. Particles require the same approach).

Thanks Adam for your answer !
We're going to test it today 😉

Loryanne

I was wondering if you guys planned to update the Unity runtime at some points so it can be used with Unity 4.3 new sprite system ?

  • Düzenlendi

Spine can't hook onto 4.3's new Sprite renderer since Sprite Renderers don't expose any of the things Spine needs to be able to do FFD and skinning. Particularly, it needs control over the mesh vertices.

That's interesting about the base Renderer class actually having settable sortingLayer properties though. I hadn't noticed. I wanna try that too and see if it works as it should.

I just tried this today too. The sorting layer properties do work fine for Mesh Renderers (and therefore, with Spine's SkeletonComponent).

It's still weird that Unity devs keep deciding to name properties with a lowercase first letter.

Anyway, thanks for the link, Chounard. This is interesting too.

Spine can't hook onto 4.3's new Sprite renderer since Sprite Renderers don't expose any of the things Spine needs to be able to do FFD and skinning. Particularly, it needs control over the mesh vertices.

yeah I had that fear :/ , I didn't dig into unity 4.3 yet, but I thought they might let you get the mesh and vertices thought the renderer, just like in 3D.