About the Animator and IK

Haytam95

Active member
Hi!

I've two more questions about the transitions of animations. I'm implementing UCC from scratch, without the demo scene and i'm a little stuck with some basis.

So, i'm trying to make the transition between two animations, from idle to walk injured (it's just normal walk... Later i'll be playing with it). My animator has this:

1571177409318.png

Inside movement:

1571177438186.png

Inside Idle:

1571177469091.png


Time for the questions:


- Movement set id? What is that "2"? (I've copied from the example) (Also i've noticed that "Adventure movement" has an "AbilityIntData" = 1 and Combat movement has AbilityIntData = 0. How are these being used?

- Ability Change? Is some event? (I couldn't find it in the documentation).

- Ability Index 0 = No ability active?

- Slot item state index?

- Leg index. I understand that 0 is right and 1 is left, no doubts here. Just wanted confirmation.


And last and more important. Why it could not be working? I know that the Demo is a little more complex, because it uses a Blend three to use different animations, when the character si running in differents directions. My intention is, for now, just make the character play the animation when he moves.


------------------------------

And about IK, it's a short one. When playing the Idle animation (i've tried with T-pose and it doesn't happen) the character foots move a little crazy, trying to align to the ground. Take a look:


But it works well when a leg is, for example at more height:


Thanks!
 
Last edited:
I can't comment on the IK, haven't seen that, but most of your points are covered here:

Seeing how they are used in the demo animator is very helpful.
 
Hi DankP3, thanks for your comment.

I've already checked out the documentation params and the Demo, i understand what most of the params are, but no the default values.

Have any clue about those?
 
- Movement set id? What is that "2"? (I've copied from the example) (Also i've noticed that "Adventure movement" has an "AbilityIntData" = 1 and Combat movement has AbilityIntData = 0. How are these being used?

"The character’s movement is split into two basic states, Idle and Movement. When not in motion and no other abilities are active, the character defaults to Idle. If the character is not in motion but aiming, the character defaults to Aim Idle. Same thing if the character is in motion, the character could either be in Movement or Aim Movement.
Aim Idle and Aim Movement are then broken down into three different forms of such movement in the default animator: Aim, Melee Aim, and Bow Aim. Each of these aim movement styles correspond to the Movement Set ID value which is set on each individual weapon. In this case all shootable weapons (outside of the bow) are going to Aim (Movement Set ID = 0), melee weapons are going to Melee Aim (Movement Set ID = 1), and the bow is going to Bow Aim (Movement Set ID = 2). You can customize your animator to make use of any number of Movement Set ID values, or only use one set."

AbilityIntData defines 'within ability' differences. For a simple example look at the Interact state of the demo animator (base layer) and see how each int defines a different animation to go with the appropriate type of interaction. In this example they all have the same Ability Index, but they select the specific animation.

- Ability Change? Is some event? (I couldn't find it in the documentation).

This triggers when a new ability starts, is most often used in the demo Animator to trigger a change of state from anystate, it is accompanied by an Ability Index which determines which one

- Ability Index 0 = No ability active?

Set by the starting ability, you will see this defined by the Abilities in the CharacterLocomotion component in the demo character. Index 0 is the default idle/motion iirc, other common examples for the demo are in the links I sent.

- Slot item state index?
There are two slots 0 for right hand and 1 for left hand, these indices control animator actions, such as 4 = Equip (see link above) the action may be on a timer or run from animation events. Animation events are integral to much of UCC.


- Leg index. I understand that 0 is right and 1 is left, no doubts here. Just wanted confirmation.
Right leg is 0, Left leg is 1.

I think understanding the demo animator will be critical to understanding the process as there are examples of everything in there.

You have a lot of parameters for a very simple animator (at least what we see of it).
 
I agree with everything @DankP3 responded to above (thank you!).

In terms of why it may not be working... looking at your animator you only have one transition going to Movement and that is limiting the transition to "LegIndex < .3". Removing this would allow every LegIndex value to transition to movement.

This is a complex situation in the main demo controller, but LegIndex values are utilized to transition smoothly between movement states (so that for instance when the right leg is forward it also transitions to that point in the nextx animation). For simple setup/testing you could remove that.

I would also check to make sure the MovementID, AbilityIndex, and AbilityIntData are all showing the correct values for the animator to transition to those states since you have those parameters set in the transition. I like to do the live animator so that once you hit play you can follow along with what state everything is in and see the values of the parameters real time. I would suggest removing all the parameters except "Moving = true or false" for now to test Idle v Movement and build up from there.

Hope this helps!
 
Thanks you two! I managed to make it work by removing unnecessary params as you suggested. Also the IK problem disappear.

Now i'm facing some animations problems, the animation is only looping at start. But i think that's not related to the Character Controller.
 
This may not be your issue, but do you have 'can transition to self' in the settings of transition to the looping animation?
 
@DankP3 I feel a little embarrassed and dumb asking, i think that this is something basic that i should know :oops: But thank you for being so helpful!

So, this guy is doing this:


I thought at first, that it could be a Mixamo animation problem. (I'm using those until i finish prototyping). So i've downloaded a few more and nothing. Then i decided to use the Demo animation "WalkFwd" and the problem persist, so maybe i'm missing something else.

The first thing on my mind is, that maybe the transition is overriding the animation progress, because all the animations are restarted at the same point. (i couldn't debug yesterday, it was late). If that is the case, maybe if i check the LegIndex parameter to avoid restart the animation when it's already started, it could work.

I'm at work now, but i'll try checking "can transition to self" at night.
 
Last edited:
The "Can transition to self" was already setted up.

The problem is with the transition graph

1571348600788.png

Playing around with that improved the animation. It isn't perfect at this moment, but at least works.

I need to play a little more with the animator, i don't fully understand it yet. Any advice is appreciated!

Thanks!
 
Hi, I meant do you have it (Can Transition To Self) because you do not want it, the animation may well be transitioning back to its start as soon as it has started, so uncheck that and allow it to loop. BTW, that's a very long transition duration, probably ~0.2s is more typical.
 
Last edited:
Yes "Can Transition to Self" should be unchecked, I would also change the Interruption Source to None for now and decrease the transition duration like @DankP3 mentioned.

There are so many transition properties so my advice would be to start with the default on everything and change as needed. Play around with the settings to test out what happens using this page as a reference: https://docs.unity3d.com/Manual/class-Transition.html.
 
Thank you @Sarah and @DankP3

Now the animation transitions are working great. I will keep searching about the IK problem, it's probably related to some kind of problem with the idle animation, i think. (I've found out that the problem disappeared before, because the idle animation loop wasn't working properly).

Anyway, you two helped me a lot so thank you again! You're awesome!
 
Top