#I'm trying to play two animations on different body parts at the same time.

1 messages · Page 1 of 1 (latest)

placid hearth
#

Here's what I've done so far:

  • A GameObject named "Player", with the necessary bones.
  • A Animator Controller, that is attached to the GameObject
  • Two Avatar Mask's, one for the Arms and one for the Legs, which are attached to their respective Animator Controller Layers.
  • The Animator Controller is configured with three layers, with States, and triggers.
  • A script to play the animations when the "W" key is pressed, which causes the "Walking" animation to play on the whole body, but not the "Aim" animation.
#

When I press "W", it kind of plays the "Walking" animation first, switches to the "Aim" animation for a movement, and then repeats itself.

trail flare
#

What are the transition settings and conditions from Any State to Empty on Arms slayer

#

@placid hearth Or rather I'd tell you to skip any transitions in the layers
And any states beyond Aim and Walking

#

The issue is probably that you're transitioning to the empty states every frame, as you can't have a condition for "Aim not triggered"

#

But they're also unnecessary so it probably doesn't matter

#

You're enabling the Walking and Aim animations by layer weight to begin with, you don't need transitions to Walking and Aiming inside those layers on top of that

placid hearth
#

I hope this is the correct stuff you're asking for.

trail flare
#

The transition condition in second image implies that you transition to Empty from any state when Aim is triggered

#

So away from Aim state in other words

#

But regardless of that I suggest you don't bother with Empty states or Any State transitions
They're unnecessary and likely confusing

placid hearth
#

Like this?

trail flare
#

No Exit transition or Any State transition either

#

Unless you also want to restart the Aim animation by the Aim trigger parameter

#

Then you can have an Any State transition to it
(and must enable Can Transition to Self in transition Settings, and likely want to reduce the delay so it doesn't wait for the full duration of the animation to run before restarting it)

#

But if it's a looping Aim animation then you don't need to restart it

#

It can just loop on the layer by itself, and you only need to change layer weight whenever you want to aim

placid hearth
#

Sorry, on the phone. few min

#

I'm back. Give me a min to see what you wrote.

#

Would it be possible to just tell me the setup for the animator controller to get it to work?

#

Or provide an example?

trail flare
#

Can't really make a state machine simpler than that

#

You don't even need the trigger or any parameters in that case, only to change layer weight

#

Even if the clips don't loop, or don't loop properly, you can test that the layering and masking works that way

placid hearth
#

It's weird, it just plays the Walking animation and skips over the Aim one. Hmm

#

The layering and masking doesn't appear to work.

#

The Walking animation plays for the whole body.

#

Is it alright that I'm using .anim files, instead of fbx files for the Animator Controller states? Doesn't affect anything

placid hearth
placid hearth
#

The Avatar Mask's don't appear to be working?

trail flare
#

I've never set up a Humanoid Avatar or used Mixamo either so that side of things I can't help with

placid hearth
#

Understood

#

Thank you though

placid hearth
#

To follow up on this, I tried using a free humanoid with animations asset with the Unity store and so far is appears to support masking. Animating separate body parts appears to be working so far.

trail flare
placid hearth
#

Do many people try to use two animations at once on different body parts?

trail flare
#

Not uncommon

placid hearth
#

Interesting.

trail flare
#

Mixamo users never stick around to help each other though, it seems

placid hearth
#

I wonder if I was just doing it wrong. I downloaded a imported the Maximo model and animations separately, idk.

placid hearth
trail flare
#

Supposedly humanoid avatar masking would not care about what the avatar is, as long as it's configured to be correct
The system is a mapping of rig's bones into standardized limb definitions
I'd imagine if the bones are mapped to limbs correctly and the animations themselves work, masking probably should as well
But from the looks of it there are a lot of pitfalls in the definition process, and exporting process too

trail flare
#

Whereas doing it manually is more something you get invested in

placid hearth
#

When I used the asset from the store, it mentioned something about there needing to be a extra bone in the model, somewhere between the upper and lower body, for separate animations to play. Kind of matches what I was, with the walking animation overriding the entire models animations.

#

Sadly, I am most likely going to disappear too soon, as I only needed assistance with getting it to work, and now I can move on to different aspects of my project.

#

I mostly like doing everything in code if possible, aint too good at the model/animation aspect, and def can't do custom models/animations.

#

I just thought that it was proper to inform someone of my findings, instead of just disappearing.

trail flare
placid hearth
#

You could be right, but I personally aint going to go back and figure it out.

trail flare
#

Quite
Additionally you can skip masking with additive animation layers

placid hearth
#

I tried using additive animation layers during my testing, but it didn't help.

trail flare
#

Only motion in the animation clip away from the reference pose is added in

placid hearth
#

I mean, using masking and additive animation layers

trail flare
#

(But the reference pose will need to be defined, and not every clip is suitable for it since they only need to move the relevant bones)

placid hearth
#

Overall, it works now, and I don't want to figure it out anymore. sorry.

trail flare
#

Fair ^^ most important is that you have something good enough

placid hearth
#

Yep