• Unity
  • [Unity] Spine Unity Examples

MelanieA ha scritto
Shiu ha scritto

@[cancellato] you can select keys in the Dopesheet then in the Graph Editor set the keys to be stepped. This can be done on the white keys in the top row of the Dopesheet to affect all keys on that frame.

Heya!

I did know about these, but when it gets to the programmer, for some reason in unity it doesn't seem to recognize that particular command no matter how we put it in?

In that case I think Mitch will need to take a look at it.

Shiu ha scritto
MelanieA ha scritto
Shiu ha scritto

@[cancellato] you can select keys in the Dopesheet then in the Graph Editor set the keys to be stepped. This can be done on the white keys in the top row of the Dopesheet to affect all keys on that frame.

Heya!

I did know about these, but when it gets to the programmer, for some reason in unity it doesn't seem to recognize that particular command no matter how we put it in?

In that case I think Mitch will need to take a look at it.

Actually, Shiu, the programmers just retried it with the Stepped graph curve and it worked fine! XD I guess they hadn't tried that particular thing before. Thanks a bunch!!!

3 mesi dopo

Hi Mitch! I have been searching for an example of this all over the internet but have come out empty handed, perhaps you could shed some light. The simplest way i could explain what i want to do is what your site defines as Procedural Animation. I would like to walk and shoot/attack at the same time. If there is already an example or tutorial that shows how to do this please point me in the right direction! Thanks in advance!

hi,how to use IK in unity?

I will be posting more examples now that the runtime update is live.

Starting next week heh - participating in global game jam this weekend.

xEclypze ha scritto

Hi Mitch! I have been searching for an example of this all over the internet but have come out empty handed, perhaps you could shed some light. The simplest way i could explain what i want to do is what your site defines as Procedural Animation. I would like to walk and shoot/attack at the same time. If there is already an example or tutorial that shows how to do this please point me in the right direction! Thanks in advance!

edit: As Pharan has pointed out I posted my own function before, what you want is:

skeletonAnimation.state.SetAnimation(track, name, looping);

@Halfbiscuit. There's no such thing as PlayAnimation natively in the Spine runtime. That method signature also looks unusual. You must have implemented something yourself.

But yes, SetAnimation requires that you specify a track number as the last parameter.
Setting an animation on 0, and then another on 1 will make it play both animations at the same time.

Hi ,

We are using Spine and Unity. But the issue we are facing is that on one or two frames are being lost when the same animation is exported and run using Unity. Things are fine when we use the same in Spine.

Any help will be greatly appreciated.

@Pharan Yep my mistake, I used my own function as an example.

skeletonAnimation.state.SetAnimation(track, name, looping);

is what is needed.

Also

skeletonAnimation.GetCurrent (track);

can be used to change the time scale and other variables after the animation has been set.

Hi everyone! I plan to buy Spine this weekend will this runtime support the latest version of Spine and Unity 4.6.1? thanks

Yes, it works with 4.6.1.

And you'll be in good company.
Lots of people using it (based on forum posts at least). Lots of people checking for bugs, awesome people improving it and fixing stuff.

4 giorni dopo

Immagine rimossa a causa della mancanza di supporto per HTTPS. | Mostra Comunque

Mr. raptor has baked translate handle pie!

Wohoo! Spine + Mecanim love. I think there was some tool floating around last year to import Spine exports as anims, nowhere as powerful and elegant as this though.
Don't know how you're doing it but awesome job, Mitch.

Immagine rimossa a causa della mancanza di supporto per HTTPS. | Mostra Comunque

That bit in the beginning was filler.
Sure, thanks for the image, not for the totally almost-useless facts about the spine runtime skin system. XD

Pharan ha scritto

That bit in the beginning was filler.
Sure, thanks for the image, not for the totally almost-useless facts about the spine runtime skin system. XD

Crap lol, you know I recorded that video like 5 times and I totally forgot to thank you for that stuff in the last take too so here goes.

When I'm in the middle of the developing a spine-unity feature and it gets weird and I'm not sure if the UX makes sense or theres some bug, Pharan and I get on Skype screenshare and do what's called pair-programming to hash things out. Sometimes with Nate too - but he just starts posting pictures of his dog's surgically repaired butt after a while ( srsly tho he's super helpful when I am neck deep in the runtimes ).

It's so cool that this kind of advanced collaboration and knowledge pooling can occur in three totally different time zones between people that have never met in person.

Thanks for the help 🙂

Forget that. What happened to Moo's butt?

Her anal glands were filling up weekly so we had them removed a while ago. She's fully recovered now, but there was the risk of permanent incontinence and her poor bunghole was a ghastly sight. Good for waking up Mitch when he gets off topic! 8) Little Moo also had giardiasis a few months ago, I have a few bloody stool pics Mitch hasn't seen. Yet. :devil:

You know people can get giardiasis too, right?
You should have your butt checked, and your anal glands cleared. And don't touch the pizza.

Spine and Mecanim! That is seriously awesome.

Whoa whoa whoa, what........ t-minus 2 weeks til we buy this and massive prototyping happens. 😛 If we can still swap attachments for equippable items and do everything we need to make an ARPG with Spine + Mecanim I shall love thee forever. I really, really didn't want to have to work with Puppet 2d.

Majicpanda ha scritto

Whoa whoa whoa, what........ t-minus 2 weeks til we buy this and massive prototyping happens. 😛 If we can still swap attachments for equippable items and do everything we need to make an ARPG with Spine + Mecanim I shall love thee forever. I really, really didn't want to have to work with Puppet 2d.

Immagine rimossa a causa della mancanza di supporto per HTTPS. | Mostra Comunque

^ all attachments added to skeleton are stored as separate game objects with 1 mesh per attachment (Region, Mesh, or SkinMesh with weighting intact) under a parent "Slot" object (named the same as the slot was named in Spine) and their render-orders are set according to the draw order of the Setup pose (doesn't handle DrawOrder keyframes).

You are more than welcome to toggle those on and off with code 🙂 Or add your own - just remember to set the renderer's orderInLayer to the right depth.

Additionally, with Unity 5 around the corner, if they do a good job implementing Mecanim graphs for arbitrary logic, you can expect a proper Spine-Unity implementation of SkeletonRenderer + Mecanim, rather than baked objects like this. That is as soon as I have time to do it 🙂


Added tutorial on how to use the new Attributes recently added to the runtime to make life easier.

6 giorni dopo

This is AMAZING!!! :clap: I was really used to using Mecanim for animations before transitioning to Spine. Fantastic work Mitch! I cannot wait to integrate this. Our Alpha version of our game is almost ready and I will definitely be using a lot of these features for our beta. :rock: I know I tell you all the time Mitch, but seriously nice work, thank you soooo much!

5 giorni dopo

Hello,

I am having trouble removing the Spine runtime from Unity.

I baked the animations and dragged from the baked folder into my project.

Everything works fine, but when I remove the spine-unity folder, my animation disappears.

Any idea what's going on?

Thanks.

cdman ha scritto

Hello,

I am having trouble removing the Spine runtime from Unity.

I baked the animations and dragged from the baked folder into my project.

Everything works fine, but when I remove the spine-unity folder, my animation disappears.

Any idea what's going on?

Thanks.

Did uhh... did you delete the Shader too?

Derp! That's exactly what happened.

Just had to move the shader out.

Thanks Mitch.

Mitch ha scritto

Added tutorial on how to use the new Attributes recently added to the runtime to make life easier.

Hi Mitch, I'm receiving this error:

NullReferenceException: Object reference not set to an instance of an object
UnityEditor.Graphs.AnimationStateMachine.TransitionInspector.OnEnable () (at C:/buildslave/unity/build/Editor/Graphs/UnityEditor.Graphs/AnimationStateMachine/TransitionInspector.cs:74)

I installed the Spine's RunTime by the Unity installer you posted at the first post.

Another problem I'm facing, happens when I try to use the "AtlasRegionAttacher", which load the image of the attachment with half of its size, and rotated in 90º.

I fallowed all the steps of this setup:
https://www.youtube.com/watch?v=-V84OIvZdQc

[Unity]

aww. it doesn't work for message contents.

Imagine the abuse!

Each time a unity logo is displayed a kitten dies. So use with caution 😉

12 giorni dopo

Hi folks, I just bought Spine and so far it has been great! So congrats on the work so far!

I am using Spine with Unity and I am trying to find the best way to switch between animations. For example I have a shooting animation and when the shooting animation has been completed I want to return the character to either idle or running depending on its state upon completion of the shoot animation. I used to do this by adding animation events within Unity itself. Spine doesnt appear to have access to the animation panel within Unity just yet so what is the correct way for performing an action like how I am describing? I see that you can add events in Spine itself. Can these be used for what I describe? So I would add an event in Spine for when the shooting animation ends and then in Unity somewhere in my script I need to listen for that event? How is this done in C#?
I have seen this http://esotericsoftware.com/spine-events and I see code sample for adding a listener but I dont seem to be able to do the same thing within C# script. Can I see an example of how this is mean to be accomplished?

Thanks!

@[cancellato]
You want to subscribe to yourSkeletonAnimation.state.Complete

If you don't know how C# delegates work and to subscribe in C#, look it up.
It basically looks like this:

yourSkeletonAnimation.state.Complete += YourHandleCompleteMethod;

It will pass parameters and stuff to your method that you'll find useful.

For more info on the difference between Complete and End, see the information linked below (eh?? Unity inside joke):
viewtopic.php?f=8&t=4050

Thanks @clandestine and @[cancellato]

These are both the answers I was looking for. I now have it both working with mecanim and using the spine delegates 🙂 Now I just need to decide which way I want to go with for future work.

Thanks for quick replies

It's worth mentioning that the SpineAnimation way with delegates is more predictable as there can be weird things that happen with keys during mecanim blending.

Mitch ha scritto

It's worth mentioning that the SpineAnimation way with delegates is more predictable as there can be weird things that happen with keys during mecanim blending.

What kind of weird things? Strange blending of some kind, or inconsistent clarity on the "end" of an animation state?

[EDIT]
Nevermind I figured it out myself following this Unity forum thread -> http://forum.unity3d.com/threads/drawing-order-of-meshes-and-sprites.212006/

However if you have a better/simpler idea please let me know 🙂


Hello Mitch,
my name's Marco and I'm the founder and main programmer at Chestnut Games. 🙂
We are planning to buy Spine since it's an amazing piece of software and seems a great fit for our latest project, but we have one main concern regarding Spine and Unity 2D integration.

  • How does Spine deal with Unity 2D sprites and sprite packer? While the sprite packer is not a must (even though it would be super great to have it work to keep our workflow consistent), our new game 2D engine heavily relies on sprite layers and orders.
    We basically have a 2D/fake 3D environment and we change the sprites sorting order at runtime to make dynamic 2D objects to move back and forward other 2D sprites. Is this something we can easily achieve with Spine animated characters? I don't care about changing the internal hierarchy of the character itself, but it's very important that we can kinda set a general sorting order for the whole skeleton, so it can go behind a in front of other game objects as it moves in the world (it's a 2D world, so just X/Y without Z dimension). Hope I was clear. 🙂
    Thanks and keep up the great work!

Do'not work Spine on Unity5 (5.0.0f4)
https://unity3d.com/jp/get-unity/download?ref=personal
http://netstorage.unity3d.com/unity/5b98b70ebeb9/UnityDownloadAssistant.dmg
I try this url
http://esotericsoftware.com/files/runtimes/unity/spine-unity.unitypackage
and
https://github.com/EsotericSoftware/spine-runtimes/archive/master.zip

import to
Spine Trial/examples/hero/export
renamed this files.
hero-mesh.atlas


hero_atlas.txt
hero-mesh.json


hero-mesh_json.txt
hero-mesh.png
hero.atlas


hero_atlas.txt
hero.json


hero_json.txt
hero.png

but

Do'not work Spine on Unity5 (5.0.0f4)

and I try this forum

http://ja.esotericsoftware.com/forum/search.php?keywords=Unity5
http://ja.esotericsoftware.com/forum/viewtopic.php?f=7&t=3713

but i can’t.

please help me.

hero.atlas.txt
hero-mesh.json

21 giorni dopo

Is there any way to REMOVE an attachment in code? I prob missed something in the videos, but just curious if anyone knows off hand. Thanks!