SysOp

Hi!

Quick question. So, I've got this character which can run, walk, and have idle animations:



Using the examples on spine-workshop, specifically, the bow procedural thing, I was able to have it aiming a pistol, and have different animations for the legs (run, walk). Awesome that.

Problem is, that I want him to use different aimings, and shooting animations as well. I use:

Animation currentAnimation;

currentAnimation.apply(skeleton, time,true);
... for the legs. I can set a different animation and will change, by doing:
currentAnimation = json.readAnimation(file, skeletonData);
But, for the torso, I've got:
bowAnimation.mix(skeleton, time, false, 0.9f);
... which only mixes a single animation once. If I set a new animation by doing:
bowAnimation = json.readAnimation(file, skeletonData);
... is like ignored.

What am I doing wrong?

Second question. How could I reproduce an animation backwards? Like... I animate a pistol deploy. Playing it in reverse mode/backwards, is like it would holster the pistol.

Tons of thanks in advance!
사용자 아바타
SysOp
  • 전체글: 30

Nate

First question, I can't follow what you are asking. Use apply with your bow animation if it doesn't affect the legs and you don't want to mix it.

Second, start the time at animation.duration and subtract the delta time until you reach zero.
사용자 아바타
Nate

Nate
  • 전체글: 11932

SysOp

Let's say I've two sets, legsAnim, torsoAnim. I want to control legs and torso separately. I've seen this is possible on the examples over spine-workshop. But the example only covers two animations mixed (bow+walk).

I've got,

walk (legsAnim)
run (legsAnim)
pistol_idle (torsoAnim)
pistol_fire1 (torsoAnim)
pistol_fire2 (torsoAnim)

For Walk and Run I use legsAnim. For the rest, I use torsoAnim. I mix torsoAnim using MIX(), and the two animations merge.

However, I tried torsoAnim.apply for animations like pistol_fire1, pistol_fire2, but only works if loop is true and if animations are different. :'(

I would like to use, for example, if player is using a rifle, "rifle_idle". If it fires "rifle_fire1". If uses a pistol, "pistol_idle", if fires "pistol_fire1". That for the torso. For the leg set is working perfectly fine.

To make it short and understandable, how could you, for example, in your AnimationProcedural example, mix 4 animations? Run, with Bow 1 or Bow 2 or or Bow 3, with no loops for the bow animations?
사용자 아바타
SysOp
  • 전체글: 30

Nate

SysOp 작성:However, I tried torsoAnim.apply for animations like pistol_fire1, pistol_fire2, but only works if loop is true and if animations are different.
https://code.google.com/p/libgdx/wiki/G ... _Statement

For a "shoot" animation you probably don't want to use mix. But yes you can apply multiple animations:

apply(walk)
mix(pistol_idle)
mix(pistol_fire)

If your lower and upper body animations don't affect the same bones, then don't use mix at all.
사용자 아바타
Nate

Nate
  • 전체글: 11932

SysOp

If your lower and upper body animations don't affect the same bones, then don't use mix at all.
Oh, silly me. I thought mix is used to... mix one animation with another. Mix, as it is, is more like a blending and that was my issue.

I just use a simple Animation var for legs, and AnimationState for torso, no mix functions used at all, and works like a charm!

Here's a video:

http://www.youtube.com/watch?v=AoFvx34BtT4

Thanks a lot!
사용자 아바타
SysOp
  • 전체글: 30


다시 돌아감: Editor