Zink120

Hello!

I've done a bunch of searches, but haven't managed to find much about how to use Spine on a Canvas. I found this topic: http://fr.esotericsoftware.com/forum/Spine-asset-to-Unity-s-UI-7071 but it wasn't much help.

Basically, I've managed to get my animation to appear in the scene view, but it's not showing up in the game view. (See attachment below).
I'm a bit of a novice with Unity UI (it took me long enough to even place the animation where I wanted it because of Rect Transform...), so please don't hesitate to suggest things that might seem totally obvious! The various components slapped onto it are copied from the black bar image, since that was actually showing up.

Many thanks, any help greatly appreciated :-)

Screen Shot 2017-04-09 at 00.49.37.png


Edit: I should add I'm on Unity 5.3.3 and Spine 2.1.27. Updating is, sadly, not currently an option.
Zink120
Posts: 8

rajesh@Unity

Spine doesnt work in the Overlay mode of the canvas . It works fine with Camera space and World Space . Why it does not work with overlay ,not very sure !
rajesh@Unity
Posts: 1

lbranjord

Interesting to know that it DOES work in world space - we will use this in our development! Thanks for the info
lbranjord
Posts: 2

Pharan

Are you saying SkeletonGraphic didn't work for you?

I recommend you familiarize yourself with Unity UI and its basics if you intend to use it extensively in your game. That way, you will also understand what limitations you have when rendering Spine skeletons in UI.

Note that Unity's Canvas element by default only captures and renders UnityEngine.UI-based renderable components. MeshRenderer (which the normal SkeletonAnimation Spine component) is not one of these things. This is why you need to use SkeletonGraphic for UI things, and SkeletonAnimation for non-UI things.

You can get MeshRenderers to render with UI by setting the Canvas mode to Screen Space Camera. It wouldn't be the default way to go about screen-space UI, but it would work, albeit with some extra work setting up a camera for it.
Official Esoteric Assorted Furniture Cleaner and Teahouse | Check out the Spine Users Tumblr Blog: spine-users.tumblr.com
pharan.deviantart.com | pharantriestoanimatestuff.tumblr.com - - - Windows 10 - Spine-Unity.
User avatar
Pharan

Pharan
Posts: 4273

avrahamy

Hi,

We also have the same problem.
The Canvas is in "Screen Space - Camera" mode and the Skeleton Graphic is only visible in the Scene view.
The problem remains in all render modes (World Space and Overlay as well).

We used to use the SkeletonRenderer and "manually" set the sorting layer and sorting order, but when I learned about Skeleton Graphic I thought I could save that extra complexity...

We're using Spine 3.6.34 and runtime 3.6 2017-07-11.

Thanks!
User avatar
avrahamy
Posts: 3

Pharan

Can you show your setup (Canvas settings, hierarchy and component setup)? or open a new topic?
I'm not sure if your case is related, especially since OP didn't reply to confirm their setup. They didn't seem to use SkeletonGraphic. (the screenshot shows a SkeletonRenderer in a canvas, which obviously won't work unless the canvas you have awfully specific settings.
Official Esoteric Assorted Furniture Cleaner and Teahouse | Check out the Spine Users Tumblr Blog: spine-users.tumblr.com
pharan.deviantart.com | pharantriestoanimatestuff.tumblr.com - - - Windows 10 - Spine-Unity.
User avatar
Pharan

Pharan
Posts: 4273

avrahamy

Right!
I'll post a new topic.
I thought the OP did use SkeletonGraphic.

EDIT: OMG, so embarrassing. For some reason the SkeletonGraphic was at Z -1000 :o
Everything works as it should :D
User avatar
avrahamy
Posts: 3


Return to Unity