• Unity
  • 3.5+ Attachments And Mixing

Related Discussions
...

Yes, please assume that the default state of any animation that I say is not looping, unless stated otherwise.

in my opinion They shouldn't have different results. I would prefer all other results to match case 1, obviously. But of you absolutely must case 2. These updated animation states have resolved a lot of ambiguous behaviour, but this case still remains.

uh, hate to be /that/ guy. but I made those changes (assuming SkeletonViewer.cs isn't a thing). And we are getting some strange behaviour(popping). I cant debug it at the moment, but will let you know whats happening when I can😛


23 Nov 2016, 17:15


ah, I see the problem.

Say if the character gets knocked over,

We use to do this:

SetAnimation("FallOver",0,false);//Track 0, not looping
//Wait for time 
SetAnimation("GetUp",0,false);
...Other GetUpCode

where we want the character to remain where the fall over left off.

I would ask if the code should look like this:

SetAnimation("FallOver",0,false);//Track 0, not looping
addAnimation("GetUp",0,false,time);
//Wait for time 
...Other GetUpCode

However time may be changed while the character is on the ground.

How do you suggest this should be handled? Should this be a different thread?

This is where NodeCanvas shines. The visual FSM lets me set up a transition from FallOver to GetUp basically only when FallOver is completely finished. You guys aren't using any kind of state machine? Even Mecanim could be used here.. I posted a thread on how to use it with SpineAnimation (not Animator).

Idea of my animation system is to feed inputs to params and the states transition automatically based on met criteria. Having to code all this out by hand for something this complex seems like a nightmare.

well, we could just alter the GetUp track entry start time, as would mecanim or some statemachine. but this is... as a teenage girl would say "like...so...totally ugly" . The less you have to touch an api the better

We don't even use AddAnimation anywhere in our code since we rely on the transitions to do all the work at the right time so I can't help out much in that department. I just couldn't find any actual use for it.. I get why it's there, but when you can call SetAnimation at the exact moment you want, well.. yea 😉

I guess my Mecanim and NodeCanvas threads didn't appeal to anyone.. really confused as to why. Mecanim is amazing... you could use a blend tree for a lot of your problems, but I get it if people aren't too familiar with the tool and then on top of that how to write Unity 5.0 Mecanim behaviors and put them on states.

TrackEntry trackEnd defaults to the animation duration for non-looping animations. If you want to keep applying the animation, set it higher:

SetAnimation("FallOver", 0, false).TrackEnd = 99999;

It will keep applying FallOver for a very long time or until you have it do something else. Past the animation duration it will pose the skeleton as if it were the last frame.

Nate yazdı

TrackEntry trackEnd defaults to the animation duration for non-looping animations. If you want to keep applying the animation, set it higher:

SetAnimation("FallOver", 0, false).TrackEnd = 99999;

It will keep applying FallOver for a very long time or until you have it do something else. Past the animation duration it will pose the skeleton as if it were the last frame.

This works!.....

More or less,

The problem with using entry.TrackEnd = 999 is that it screws up blending. whether this is new to 3.5+ I do not know, but it certainty happened pre-patches (in this thread and the other thread, which I was able to revert).

And before you ask it also happens in the skeletonviewer, which when you play an animation it also alters the entry.trackend time.

Concider the following:

The Last Frame of TakeHit_KnockBack:

HTTPS desteği olmadığı için görsel kaldırıldı. | Yine de Göster

Is the same as the first Frame of TakeHit_Land

HTTPS desteği olmadığı için görsel kaldırıldı. | Yine de Göster

When you alter TakeHit_KnockBack .TrackEnd = 999

setAnimation("TakeHit_KnockBack",0,false).TrackEnd=999`

Wait for an amount of time < 999 seconds and

setAnimation("TakeHit_Land",0,false)`

You get weird mixing results, which didn't happen when altering the track end was not required:

HTTPS desteği olmadığı için görsel kaldırıldı. | Yine de Göster


(0.28 mix, playing at 0.25 speed)

For reference it use to happen like there was no mix:

HTTPS desteği olmadığı için görsel kaldırıldı. | Yine de Göster


(0.0 mix, playing at 0.25 speed)

(and sure we can set the mix to 0, but this behaviour is a bit strange)

Thanks for the nice explanation. This looks like the dip problem, TakeHit_KnockBack mixes to the setup pose while TakeHit_Land mixes in.

BTW, the latest Skeleton Viewer (just updated) no longer sets trackEnd when non-looping. We might add a "Hold" checkbox to hold the last frame of non-looping animations if people would find it useful.

BinaryCats yazdı

This works!.....

... UH, By that I mean it didn't break everything I guess.

The animation sequence:

SetAnimation("Idle",0,true);
SetAnimation("SwordOn",1,false); // Where swordOn is a one frame animation, and default mix is 0.2

This results in the Sword remaining on, after the SwordOn animation completes. I thought this change would have made it be removed as it mix'ed with setup pose? (where the sword attachment is off)
Is this correct?