• Runtimes
  • Problem with Combine animations. Help me!!!

Related Discussions
...

I'm running two parallel animations (run and attack_idle). Run runs at track 0 and attack_idle runs on track 1, but when run, the torso_target (which is circled) takes up the position of the animation at track 0 (run). Is there a way to get that torso_target to the location of the animation in track 1 (attack_idle)?
Thank you for your help so much :$ :$ :$

Track 0 is applied first, then track 1. If the animation for track 0 keys torso_target and track 1 does not, then it'll be where track 0 keyed it. If you want it somewhere else you can key it in the track 1 animation. This will overwrite the pose from keys in any lower tracks.

Thank for your reply but I do not really understand.
When start game i use:

  • anim.state.setAnimation(0, "run", true);
    And when player click to attack, i use:
  • Case 1:
    anim.state.setAnimation(1, "attack_idle", false); -> torso_target takes up the position of the animation at track 0 (run)
  • Case 2:
    anim.state.ClearTrack(1);
    anim.state.setAnimation(1, "attack_idle", false); ->torso_target takes up the position of the animation at track 1 (attack_idle)
    Actually I do not understand what spine reads my code.

And How i can lock it in track 1 animation?
As I read in the spine's documentation on combine animation, my animation attack_idle must have a keyframes at torso_target, but my artist says it's not moving so it can not have a keyframes.
Thank so much for your help

If I understand, you say when you do this:

anim.state.setAnimation(0, "run", true);
anim.state.setAnimation(1, "attack_idle", false);

Then you see torso_target positioned where it is keyed in animation run. Is that right? Is torso_target keyed in animation attack_idle?

And you say when you do this:

anim.state.setAnimation(0, "run", true);
anim.state.ClearTrack(1);
anim.state.setAnimation(1, "attack_idle", false);

Then you see torso_target positioned where it is keyed in animation attack_idle. Is that right? If torso_target is keyed in both animations, you will see the torso_target position from the animation on the higher track (track 1 in your example). Clearing track 1 first does not affect this at all.

You can use the Preview view in the Spine editor to apply your animations on tracks 0 and 1 and see how they behave.

I understand. Thank you for Preview view 😃
I used the Skeleton viewer (which is similar to the preview view) and I saw torso_target take up the postion of the animation at track 1 (attack_idle). But I do not understand why you have to have ClearTrack(1) then unity to set up torso_target take up the postion of the animation at track 1 (attack_idle), if not use it still follow track 0 (run) although I know that ClearTrack is just for stopping animation.
I use spine 3.6 and unity 2018.1.0f2

You actually don't need to call ClearTrack(1) unless, as you said, if you want to stop that animation.

Use Spine's Preview view to ensure that using those animations on track 0 and track 1 will get the results you want.
If some of your keys on the track 1 animation override the wrong things from the track 0 animation, it will not work.
Preview view is a way to quickly check that without having to export your animations or without having to test it in Unity.

Yeb.I was running in the preview view but as I said above. In some miraculous way, just run the cleartrack before it runs just like in the preview view.
I tried to transfer unity 2017.3.0f but still the problem remains.
You're so great. Without you, I would die 😃