MommysBestGames

  • 17 يناير 2024
  • انضمّ(ت) 6 يونيو 2019
  • Hi,
    I just updated Spine for a new project, and the got the latest spine-unity 3.8 package for the unity import.
    I have the pro version, and exported the json, atlas, and png files for a new animation/character.
    I have installed the spine package into Unity.2018.4.7.

    I keep getting the "Could not automatically set AtlasAsset for animation" error when I pull those files into Unity.
    This usually works fine, I've never hard this problem before.
    Any ideas?
    Thank you.


    Oh wow! I think I fixed it.
    I went into the "Export->Pack Settings" section, and in the lower right, I changed the atlas extension from .atlas, to .atlas.txt.
    I think that helped Unity read it.

  • Harald,
    First of all, sorry for providing a broken example. Not sure how I didn't include the json file, that's weird.

    In any case


    that was it!
    I was using "Skeleton Utility" to follow all bones, but really I should have been using BoneFollower all along.
    At some point I think I got those two confused


    thinking they were the same thing, but they are not.
    BoneFollower script is definitely what I was looking for!
    Thank you!
    -Nathan

  • Hi, I'm having trouble and can't figure this out.

    I want to have a bone follower on the end of my tentacle animation.
    But when I did it, I can't get the follower to actually match the tentacle or move at all!

    I've created a simple test project.
    I have the tentacle animation (SkeletonAnimation), and a "Skeleton Utility" component, with all bones followed.

    Why when I look at the bone followers in the Scene view, (while the game is running), the transforms don't update.

    Here is the very small project:
    https://www.dropbox.com/s/huwmotu1km5wn5n/AnimTestTentacle.zip?dl=0

    (The picture is from the spine editor. In the game view, the animation plays (visually) fine


    I just can't get the bone transform access in a script, for attaching objects.)

    Thank you!
    -Nathan

  • I used the code method and it worked for me.
    Thanks!

    backHandIKGrab.overrideAlpha = 0f;
    this.GetComponent<SkeletonAnimation>().skeleton.SetBonesToSetupPose();

  • Harald,
    Okay, I've made a smaller animation test project, and written to the contact email.
    Thank you.
    -Nathan

  • Thanks for helping me figure this out!
    Questions:

    1. All values are set to inherit (so yes, position and rotation are set to be overridden).
    2. Yes.
      When I disable the code completely, the back and front arms do the following:
    3. Open a very quick 'shoot recoil' animation, which moves on the 'torsoGunPivot' bone back and forth, to move the gun back and forth and the front/back hands both move with it (as they are IK'd to the gun).
    4. They also follow the gun as I use code to aim the gun around when you move the right stick.
    5. If I set override Alpha to 1, I can drag the back-hand IK around, and it follows the transform, HOWEVER (and this may be a clue!) once I move the transform, and offset it some, I can't get it to follow the gun again.
      If I set override Alpha to 0, it stays stuck, just where I left it. That doesn't seem to matter.
    6. Yes, moves around when I drag the IK bone around, as I expect, and follows the gun, when I move the gun around in Spine.

    So, I noticed if I override the front hand as well, the same problem happens.
    Both hands jiggle a little bit with the gun shoot animation, but if I drag them around, they stay stuck like that.

    I was hoping there was a way to get them to snap back to a starting position.. but maybe this isn't an animation issue at all, but more of a thing where I should store their starting offset, and when I want the arm to be "off the chain and back on the gun" I should be resetting the position that way through code.

    Maybe because most of this is IK driven to follow the gun rotation, that's the issue?

    1. I tested the example scene you mentioned, and the slider worked. It reduced the movement on the dragon's head as the rider moved it up and down.

    2.
    I've attached a pic of the heirarchy for the character.
    "BackHandHold" is the bone that uses the code called "backHandIKGrab" in the original example.

    I tried the following:
    I removed all code that was modifying the bone's position.
    At that point, the animations (like shooting the gun and running) took over the bone's movement as expected.
    If I then, while the game was running, but in the Unity Scene view, grabbed the bone's override position, and dragged it around, the player's arm would stay moved up in the air, if I moved it up in the air. The overrideAlpha slider did not effect how much or how little the arm would stay moved in the air.

    Basically, once, I changed the transform on the "BackHandHold" in the scene view, (it was 0,0,0), the bone would follow the animation, but also be moved up in the air (if for instance, I moved it to (0,1,0).

    I guess I'm confused on how to get the bone to follow a world position versus follow the animation driven position.

    3.
    Hmmm.. I'm starting to think my heirarchy is the issue.
    I have a gun bone.
    Then the back hand is IK'd to the gun bone.
    So the animation for shooting moves the gun back and forth.
    And the back-hand IK's to grab the gun.
    But I want the back hand to grab a rope occasionally, but also snap back to the gun's grab point.
    Maybe I can't parent them like this? I shouldn't have "BackHandHold" parented under the "torsoGunPivot"?

  • Hi, I'm sorry if this is really simple, but I've struggled with it for several days and can't get it figured out.

    I have a character with 2 arms, grabbing a gun.
    I have IK targets on the gun, to position each hand/arm on to the gun.
    Sometimes I want the back hand to grab a rope.

    When the character is off a rope, I want it to use the animations (for where to grab the gun, and aim and such).

    What method should I use for this?

    Currently I have tried:

    1. SkeletonData Asset for the main body of the character.
    2. On that, I added a "Skeleton Utility" script.
    3. That let me "spawn a hierarchy".
    4. The back arm IK target bone, I added an override.
    5. In my player code, when he's grabbing the rope I tried this:
      backHandIKGrab.overrideAlpha = 1f;
      backHandIKGrab.bone.X = grabPos.x;
      backHandIKGrab.bone.Y = grabPos.y;
      

    When he is not supposed to grab the rope (and should follow the animations) I tried this:

    backHandIKGrab.overrideAlpha = 0f;
    

    RESULT:
    He always just follows the animation, not matter what.

    SECOND TRY:
    I also tried this for when he is to follow the rope:

                            
    backHandIKGrab.overrideAlpha = 1f; backHandIKGrab.transform.position = grabPos;

    RESULT:
    But that makes him always grab the rope, and never follow animations, even though I set overrideAlpha to 0f, when he should follow animations.

    What am I missing?
    Thank you!
    -Nathan

  • Thanks.
    Yeah, I'm starting to think I would want that animation blending method. Having it track from 0 to 1, across an animation may be best.

  • Okay, in the stretchyman skeleton, I can see there are path constraints, that are connected to IK constraints, that are connected to bone targets.
    In that example, in script code, I could move the bone that would move the IK, that would move the Path constraints.

    1. Is that the idea? Or did I miss how works?

    2 .But there's not way to grab the manipulators in script for a Path constraint?

  • Hi, I have a cool monster with a path constraint controlling his head and neck.
    I'd like the neck and head to aim in an arbitrary direction, controlled by code (and the player).

    I've used skeleton utility bone scripts to move bones around


    it's great!
    How can I grab pieces of the the manipulators in a Path Constraint to do something similar? Moving the manipulators via Script in Unity, to change the head direction dynamically?
    Thanks!

  • Hi, I'm experimenting in Spine/Unity to have a character stand on a branch. As they walk along, the branch bends more and more.

    There is a running Spine "Idle" animation on the tree/branch with leaves and branches moving.

    DESIRE:
    Specify a bone in a link of bones (on a branch, vine, tentacle) and start translating (additive/local) or rotating (additive/local) the specified bone, and also have set number of parent bones, to be influenced (with a fall-off) as well.

    I'd like a general code method, that I could add the script in Unity to any Spine skeleton game object, give it a bone, and then specify how many bones and the fall off influence going down the bones.

    I'm fine with coding this


    trying to, but I've not had perfect luck so far.

    My current solution is not generalized and needs a lot of extra art support.
    I'm using a Transform Constraint for any branch I want the player to stand on, then I have the transform constraint use the RotateMix (local), that uses 0 to 1, based on how far along the branch, the player is standing.
    It is okay, but I'm looking for something with less work in the art pipeline.

    I've looked at BoneLocalOverride, but it completely overrides the bone rotation from the animation, and I'd like keep this as "local rotations" to each bone.

    What is the best path to proceed?
    Should I keep looking at modifying BoneLocalOverride, or some other direction?
    Can I get this to work, but not expect the underlying animation to affect the bones I'm modifying?
    Thank you!
    -Nathan


    Here are some pictures, to follow up illustrate what I'm trying to do, and I'm asking what would be the best direction to pursue this in Spine/Unity.
    In the first picture, the tree would be animating, blowing in the wind, the player is falling towards it.

    (BendTree1)

    In the second picture, the player falls somewhere on the tree.
    In the code, I will detect what bone it hits.
    I want to take that bone, and a series of parent bones, and rotate them a bit, locally left or right, to bend the tree branch (or any other vine thing I'd like).

    As I mentioned, I have this working with TransformConstraints, but I wanted to know if there was a better way to generically grab bones and move them locally, to add on top of animation movements.


    -Update 2
    I've been doing tests, and so far, I'm getting better looking, more reliable results from a nice animation and a transform constraint that changes based on how far along the branch you are standing.

    I started using SkeletonUtility scripts and bone chains with hinge2Ds generated, and while it makes great results for 'true vines", I had trouble getting it to look better, for a more rigid branch with lots of various leaf areas.
    I'm thinking of still using this method though for some new plant, that is a vine with leaves on it, as the dangling, swinging and interacting you can get from all the collision boxes on the different parts could look really cool if the art were designed to make the most of it.

  • That worked, thanks!

    Yeah, I'm still using CS2


    as I imagine others are


    so if possible, for future updates, maybe give us that line again and where to change it, or a different version. In any case, thanks for the help!

  • That's the script I have.
    But in the link you supplied (if I click on it and view it) it actually says the script version is 3.8.

    var scriptVersion = 3.8; // This is incremented every time the script is modified, so you know if you have the latest.
    Is that an issue?

  • Hi, I'm getting the same problem for all my layers when I try to export them via the script. I've used the program before and it usually works, so now I don't know what I've done wrong.

    Pro Spine version 3.7.94
    Script version 3.8. (via the download)
    Photoshop CS 2.

    Here is a picture of the layout in PS. (attached).

    Can you help me? Thanks!

    Here's the errors.txt

    Layer name is not a valid attachment name:
    backLeg2Up


    Layer name is not a valid attachment name:
    backKnee2Stretch


    Layer name is not a valid attachment name:
    backFoot2


    Layer name is not a valid attachment name:
    backLeg2Down


    Layer name is not a valid attachment name:
    frontFoot2


    Layer name is not a valid attachment name:
    frontLeg2Down


    Layer name is not a valid attachment name:
    frontLeg2Up


    Layer name is not a valid attachment name:
    shoulder2


    Layer name is not a valid attachment name:
    Tail


    Layer name is not a valid attachment name:
    backThighStretch


    Layer name is not a valid attachment name:
    backFoot


    Layer name is not a valid attachment name:
    backLeg1Down


    Layer name is not a valid attachment name:
    backLeg1Up


    Layer name is not a valid attachment name:
    backKnee1Stretch


    Layer name is not a valid attachment name:
    frontFoot1


    Layer name is not a valid attachment name:
    frontLeg1Down


    Layer name is not a valid attachment name:
    frontLeg1Up


    Layer name is not a valid attachment name:
    neck


    Layer name is not a valid attachment name:
    shoulder1


    Layer name is not a valid attachment name:
    earBack


    Multiple layers for the "default" skin have the same name:
    y
    Rename or use the [path:name] or [ignore] tag for these layers.


    Layer name is not a valid attachment name:
    antBack


    Layer name is not a valid attachment name:
    head


    Layer name is not a valid attachment name:
    antFront


    Layer name is not a valid attachment name:
    earFront


    Multiple layers for the "default" skin have the same name:
    y

    Rename or use the [path:name] or [ignore] tag for these layers.