Noktai

  • 20 juil. 2015
  • Inscrit 18 mai 2015
  • Mitch a écrit

    Maybe pharan was right and I should just delete baking :/

    Baking has absolutely nothing to do with your project.

    Send your .spine file (with some blacked out source images if you must) to unity@esotericsoftware.com if you would.

    Yeah I have no idea what it does to be honest haha, I just noticed the strange behavior of it toggling on.

    I've send the e-mail, thanks for all the trouble again 🙂

  • Mitch a écrit

    Proving once again that Spine-Unity is actually my dirty 2D side project, meanwhile everyone tries to make me do all these fancy AR/VR/3D things 😛


    if( skeletonAnim == null ) skeletonAnim = animator.gameObject.GetComponent<SkeletonAnimation>();
       skeletonAnim.Skeleton.SetBonesToSetupPose();
       skeletonAnim.AnimationName = animation;
    

    adding skeletonAnim.Skeleton.SetBonesToSetupPose(); fixes your issue. your keyframes are wrong.

    That looks great, really polished for a weekend project. And the sounds totally finish it haha.

    I had already added that line of code after Xelnath had suggested it, it fixes some problems, but I the "FTZ_JumpMid" is somehow still messed up. And in the preview window everything seems to be even worse, but I can live with that I guess haha.

    So you're suggesting our problem lies with the actual animations in the spine software? I hate to be that kid in class that just can't stop asking questions, but could you clarify what you mean with the keyframes? I'm not quite sure what I should relay to our animator now.

    Edit: What might be related is that I have disabled "Bake Animations" and "Bake IK" in the skeleton, but when I run the scene the values are permanently enabled again, even when I stop playing the scene afterwards.

    Edit2: I noticed that the animations seem fine when I disable mxing
     Loading Image

    This is what it looks like with mixing;
     Loading Image

    During a tutorial it was mentioned that meshes and using mixing doesn't play well together, perhaps that could be the source of our problems? Because we are indeed using meshes on some parts.

    Thanks a bunch for all the help!

  • Mitch a écrit

    I'll take a look at it but it'll have to wait until Sunday at the earliest; got a big hackathon thing going on in SF tomorrow I gotta be at all day.

    Cool, thanks! Have fun at the hackaton 🙂

    Xelnath a écrit

    Can you try changing that to:

    skeletonAnim.skeleton.SetBonesToSetupPose();
    skeletonAnim.AnimationName = animation;
    

    That doesn't seem to change anything unfortunately 🙁

  • Mitch a écrit

    IK + FlipX/FlipY is broken all over the place. Beware if you're using Flip and IK at the same time (not just in Unity).

    We are not using IK nor Flip. We were flipping the character by changing the scaleX. But even when we enable that the problem persists 🙁

    Mitch a écrit

    Other than that, are you sure you're resetting all your bones correctly with keyframes at the start of a given animation? Its not like the Spine Editor which uses ResetToSetupPose whenever you switch animations.

    Yeah we're resetting them.
    On the tech side I'm triggering an animation by calling

    skeletonAnim.AnimationName = animation;

    Should I be doing anything else?

    Here's a demo scene where you can check out the problem, if it is of any help.
    https://www.dropbox.com/s/eu88exnly4j39yq/Spine%20Problem.rar?dl=0

    I had to mess up the textures, but it should still be clear haha.
    The animation is triggered in a StateBehaviour btw, so you need to use unity 5 for this project I guess.

  • Hello,

    We have just started out using spine for our unity game.
    Upon importing the animations in unity we noticed that there is something strange going on with some animation transitions

     Loading Image

    As you can see, both the scarf and head dissapear and interpolate to the incorrect positions.

    Here's an overview of our skeleton setup for the character.
     Loading Image

    Since we're pretty new to spine, it could be that we are doing something wrong with the keyframed animations, since those seem to be effected.
    However, here you can see that some of the bones are positioned incorrect (the sword )and that some attachments are incorrect (most noticeable on the feet)

     Loading Image

    I hope anyone can point us in the right direction.
    Thanks in advance!

  • Mitch a écrit

    Working as intended. Hit the scene Play button after setting up your state. Sorry there isn't a way to scrub an animation using this mode, Unity might expose the things I need to make that happen eventually 🙂

    The Dummy track is there simply to represent the duration of the Spine animation, so Mecanim doesn't try to blend as if its a 0 frame animation.

    Events are also written to the standard Unity Animation event track as well. (IE: using SendMessage to fire events)

    Oh right, in all my confusion it seems like I forgot to actually run the game haha. The animation doesn't seem to be looping though, I tried to enable "Loop time" and "Loop Pose" on the animationclip, but that didn't seem to make a difference.

    I will probably stick to using the Skeleton Animation though and call SetAnimation() in a StateBehaviour on the corresponding state.

  • I might be missing something obvious, but it seems like there's something wrong with the mecanim animations generated by spine.

    Upon dragging in the files in unity, the skeleton is generated automatically as it should. I went ahead and clicked "Generate Mecanim Controller".
    The controller get's generated perfectly fine, with the one animation we have inside as it should.
     Loading Image

    I then right-click the skeleton and select Spine > Instantiate( Mecanim ), which also generates a correct gameobject ( I presume)
     Loading Image

    However, when looking at the animator window, there are no states.
     Loading Image

    Same story for the animations window
     Loading Image

    I guessed I could just drag in the animation from the animator asset file, but then I end up with some missing stuff, and there is no animation visible.
     Loading Image

    Any idea what I could be doing wrong?
    Thanks!