#animator problem

1 messages · Page 1 of 1 (latest)

hollow bolt
#

.

#

made a thread

#

show me the Animator window.

supple cairn
#

k

#

ignore the missing warnings down there, those dont have to do with the problem. I have idle0 in the animator but it is not shown here

hollow bolt
#

"idle 0" is the name of the animator state

supple cairn
#

yes

hollow bolt
#

This is not the name of the animation clip that the animator state uses

#

"idle" appears correctly in that list

supple cairn
#

no

hollow bolt
#

notice how the animator state uses the "idle" clip

#

It's right there.

supple cairn
#

I put the idle0 animation clip into the animator

#

thats the other idle

hollow bolt
#

There is no idle 0 animation clip

supple cairn
#

I litterally circled it

hollow bolt
#

you can name an animator state whatever you want

supple cairn
#

its in the animator

hollow bolt
#

That is an animator state.

supple cairn
#

this is not an animator staate

#

I Dragged the animation clip into there

hollow bolt
#

An animator state is a position you can be in the animator controller.

supple cairn
#

its a clip

hollow bolt
#

I know how the animator works.

#

Do you want help, or do you want to argue with me here?

supple cairn
#

me too, im telling you its NOT an empty animator state

hollow bolt
#

I did not say it was an empty animator state.

#

I said that "idle 0" is an animator state.

supple cairn
#

I dragged a clip not an animator state in

hollow bolt
#

It was created when you dragged in the "idle" clip

#

You can't drag an animator state in.

#

When you drag a clip in, a new animator state is created.

#

By default, the state is named after the clip

#

Since you already had a state named "idle", it had to change the name

#

hence "idle 0"

#

The animator state named "idle 0" uses the animation clip named "idle"

#

If you drag the clip named "idle" in again, you'll probably get a state named "idle 1"

supple cairn
#

look, i dragged this animation clip

it is called idle 1 because there is another idle animation

hollow bolt
#

Yes.

#

You now have an animator state named "idle 1"

#

It references an animation clip named "idle"

#

The Animation window lets you look at animation clips used by an animator.

#

It does not show you animator states.

supple cairn
hollow bolt
#

because it shows you every animation clip used by the animator.

supple cairn
#

THIS IS an animation clip, its not a state, this is a CLIp

#

i put that clip in the animator

hollow bolt
#

what is "this"?

supple cairn
hollow bolt
#

Are you talking about this?

supple cairn
#

it works on the other armature but not this one called Noel

supple cairn
hollow bolt
#

Then yes. That is an animation clip.

supple cairn
#

See

hollow bolt
#

You dragged it into the animator, creating a new animator state.

#

This is an animator state named "idle 1"

#

It references the "idle" animation clip

#

Therefore, "idle" appears in the list of clips you view in the Animation window.

#

"idle 1" does not appear, because there is no animation clip named "idle 1"

supple cairn
supple cairn
hollow bolt
#

Yes. You dragged the animation clip into the animator.

#

This produces a new animator state.

supple cairn
#

ok

hollow bolt
#

These are not animation clips.

supple cairn
#

so how do i get it to show and work then

supple cairn
hollow bolt
#

Yes: basic animator states reference a clip

supple cairn
#

oh ok

hollow bolt
#

they can also be blend-trees

hollow bolt
#

You have a lot of missing channels there. Make sure that the ones that move the body around aren't all missing.

supple cairn
#

those are bones i dont use

hollow bolt
#

That's why I'm asking you to check that the bones you are using are working right.

#

There should be a deeply-nested series of channels that are all free of that "Missing!" warning

supple cairn
#

these are the bones being used

#

no yellow warnings

hollow bolt
#

okay, good, the Run clip is working right

supple cairn
#

all clips work right

#

thats how i did the game

#

it plays different clips for running

hollow bolt
#

now, make sure that you don't have any animator components attached to any other part of the character

#

those could interfere with playing the animation

supple cairn
#

you mean this?

#

its just one

hollow bolt
#

Right. There should only be one of those in the hierarchy for the character.

supple cairn
#

yes, theres only one

hollow bolt
#

now, enter play mode

#

the "Clip Count" on that animator should go up

supple cairn
#

ok

hollow bolt
#

and if you have the character selected, you should see a blue bar under one of the animator states in the Animator window.

supple cairn
#

Yes

#

Every other animation played shows that when it’s played

hollow bolt
#

If you select the character and click "Preview" in the Animation window, does anything happen?

#

It should preview the currently-selected animation.

supple cairn
#

Yes, ik this. Basic animator stuff.

hollow bolt
#

Does it work?

supple cairn
#

Idle1 doesn’t show so I can’t play it

hollow bolt
#

Again, there is no idle1 clip

#

the "idle 1" state refrences the "idle" clip

supple cairn
#

Ok

#

Idk how to put it in the animator and have the character play it right then

hollow bolt
#

Does the animation preview correctly?

supple cairn
#

Every other animation plays

#

Correctly

#

I can’t play idle1 tho

hollow bolt
#

So every other animation clip will show up properly when you preview them, but the "idle" one does nothing?

supple cairn
#

Every animation plays correctly, I can’t get it to play idle1 because it doesn’t appear in the animation tab, and even if I use a script it does nothing

supple cairn
#

Ik

#

Idk how to play it

hollow bolt
#

You want to enter the "idle 1" state.

#

You need to do something to make the animator transition into that state.

#

You can just set it as the default state so that it plays automatically.

#

(just for the sake of seeing it playing)

#

From code, you can directly enter any animator state by name.

#

animator.play("idle 1");

#

this will immediately transition into the "idle 1" animator state.

supple cairn
#

It doesn’t do anything when I script that one to play

hollow bolt
#

Look at the Animator window while your script tries to do this. Does it wind up in the wrong state?

#

If you have a transition coming out of "Any State", then that transition can always activate. This could be making you leave the "idle 1" state.

supple cairn
#

No, it tries to play idle1 but no animation plays

#

Idle1 is out in the open, nothing is interacting with it

hollow bolt
supple cairn
#

Yes

hollow bolt
#

If you turn on "Preview" in the Animation window and select the "idle" animation clip, does no animation appear to play?

supple cairn
#

I can’t select it

#

It is not there

hollow bolt
supple cairn
#

I’ve shown you a screenshot of it not being there

hollow bolt
#

The "idle" clip is in the list.

supple cairn
#

That’s the other idle

#

I’m talking about idle1

#

not idle

hollow bolt
#

There is no animation clip named "idle 1". You have not shown me any screenshot in which there is an animation clip named "idle 1"

#

These are all animation clips. None of them are named "idle 1"

supple cairn
#

It changes it to idle 1 because there’s already one in there called idle

hollow bolt
#

These are all animator states. One of them is named "idle 1"

#

you've told me you understand the difference, but it really sounds like you don't

supple cairn
#

I renamed the idle to something else and then it appeared in the animation window now. But the problem is that everything says missing

hollow bolt
#

"idleEXTRA" perhaps?

#

I see you have a clip named "idleEXTRA"

supple cairn
#

No

#

Ok wait

#

I renamed the idle I dragged in to something else, then it appeared

(I named it idleURMOM, I know, a silly name, but when I dragged it into the animator it actually showed in the list)

#

Then all the yellow warnings appeared

hollow bolt
#

All that matters for the Animation window is which clips you're using

#

The names of the animator states are irrelevant

supple cairn
#

Yes, the clip idleURMOM appeared there

hollow bolt
#

So, show me the animation window with the clip you want to use selected.

#

Expand it so that you can see a lot.

supple cairn
#

IdleURMOM shows there

hollow bolt
#

oh, I meant to expand the entire window, so we can see more

#

I'm specifically interested in what's at the top of the list on the left side

#

A view like this would be ideal.

supple cairn
#

oh ok

hollow bolt
#

Scroll that list on the left to the top.

supple cairn
hollow bolt
#

Ah, okay, this animation is very specifically looking for an object named "Catrine"

supple cairn
#

Yep

#

It works for that character

#

I want it to work on my Noel character

hollow bolt
#

other clips depend on it being named "NoelArmature" specifically

#

One option would be to duplicate the animation clip and then fix the names

#

You can rename a channel by hitting F2

#

like so.

#

If all of these animations come from .FBX files, you could also just edit them in Blender so that the top-level bones have the same names

#

e.g. rename them from "NoelArmature" to "Armature"

#

and from "Catrine" to "Armature"

#

Doing the same to the other bones to make them all match would also be helpful.

#

(unless those parts are character-specific and can't really be made uniform)

supple cairn
#

Ohhhhhhhhhhhhhh

hollow bolt
#

Generic animations demand that the armatures are exactly the same

supple cairn
#

The problem is that I would have to create another animation clip for every character, that’s what I have already so I wanna fix that

hollow bolt
#

Humanoid animations are much more tolerant in that regard.

#

If your armatures are roughly humanoid shaped, it would be an option

supple cairn
#

What do I do with humanoid then

hollow bolt
#

Humanoid animations recognize common bones, like the hips, chest, lower arms, and ankles

#

You set up an avatar on each character (which is generally completely automatic), and then animations from one avatar can be retargeted onto another

#

in your case, you wouldn't really be using the retargeting, since the skeletons are all the same shape

#

but it would smooth over the different names, probably

#

If you can just edit these things in Blender, then I'd suggest going and making the bone names consistent

#

That'd be the simplest thing to do

supple cairn
#

Ok, I had the idea of an avatar, but every time I do that on a humanoid, it just has the default avatar pose and gives me a binding warning

hollow bolt
#

(except for the top level armature)

hollow bolt
#

You can just reference the clips directly from the model assets. It's what I do now.

#

If you need to edit them, select the model asset and go to the "Animation" tab. You can edit all of the clips there.

supple cairn
#

For every character I have the same animation clip name supported for that character, so in this case I’d need to make an avatar for it to work right and switch the rig to humanoid

hollow bolt
#

right. If the skeleton has the wrong shape, though, you might have to do a lot of manual setup for each character

hollow bolt
#

You'd certainly get a T-pose if you just switched the characters to Humanoid and did nothing else, mind you

supple cairn
hollow bolt
#

the animation clips you duplicated out would still have been imported as Generic animations

#

and the generic animations aren't allowed to touch the humanoid bones

supple cairn
#

I think I understand

hollow bolt
#

You can use both generic and humanoid animations on the same animator controller

#

But the generic ones will have to only touch non-humanoid bones

supple cairn
#

You see, the animations inside the Fbx can get changed by the settings, I already duplicated the generic ones so I need to do the humanoid ones then this should be fixed

hollow bolt
#

That's why I don't duplicate them out anymore.

#

if I make changes and re-export the model, everything updates automatically

supple cairn
#

I think I finally understand! Thank you. Duplicating them is the best way to put them in the animator actually, for me at least

#

Thank you! I am pretty sure I know the problem now thanks to you, you are someone who understands and actually has patience with me and didn’t give up, is there anything I can do for you maybe?

hollow bolt
#

glad to hear. and nah, i'm good (:

just make sure you ask for clarification if something isn't clicking; we got hung up on clips and states for a long while there.

supple cairn
hollow bolt
#

Right.

#

An animator uses an animator controller

#

An animator controller has one or more layers. Each layer holds animator states

#

Animator states can transition to other animator states.

#

An animator state can just play a clip, or it can be a blend tree that combines many clips or blend trees

#

The animation clip is what actually contains the animation data.

supple cairn
#

Also avatar masks, an avatar mask can basically help blend two animations together

hollow bolt
#

An avatar mask limits what a layer affects

#

The mask has two parts

#

One is the humanoid mask. It controls which humanoid parts the layer is allowed to control

#

The other is the transform mask. It controls whether specific transforms can be controlled. That's the only one that works for generic animations.

supple cairn
#

Whenever an animation that has the legs staying still but effects the top part, you would use an avatar mask to continue the animation on the legs if they are running

hollow bolt
#

Right.

supple cairn
#

Ok

hollow bolt
#

I usually make the first layer be the one that plays the locomotion animation

#

e.g. walking

#

and then other layers use masks to affect just certain parts

supple cairn
#

So once I set up animators I will finally be able to correctly do the mask

supple cairn