Hello there
I have a character that has blinking eyes - I have made a made a new layer in the animator and using a direct blend tree to blend the eyes and eyebrows. However when I also use use the paramter for the eyebrows in the blendtree, it slows down the whole animation as if it’s in slow motion.
When I use the the blinking alone, it animates as it should.
How can I blend them and have each run their normal speed?
I’m having an idle and and happy bone animation for the whole character.
I want the happy animation to run along with a blendshape where the face is happy - how do I blend these, so the bone character is running the same time as the happy face blendshape?
Any direction would be much appreciated
Cheers, Dan
It’s hard to tell what the problem might be without seeing how you’ve got it set up. Some screenshots and/or video would probably help.
Problems like this are often hard to debug because you have no control over what blend trees do internally, nor even any access to it. You might be interested in my Animancer plugin (link in my signature) which has a feature called Animation Mixers. They are very similar to blend trees, but you configure them in code and have full control over everything they do.
Hi SilentSin
Thanks for quick reply.
Well, it’s basically that I have made a blinking animation in the animator and have a layer for that, so it constantly blinks.
If I make a direct blendshape, FacialExpressions, and include the blink animation in that with other animations also, the blink is no longer played the same speed as if it’s it its own layer.
I guess it’s because the direct blend tree is more to set the amount for a specific blendshape, rather than a list of animations I have played.
However If I have an animation, say “walk” in my base layer and then blink in another layer and I want my character to smile after 20 seconds, will I need to make a 3rd layer for that or is it better to use a direct blend tree?
I just read that using direct blend trees is good for making facial animations based on blendshapes.
My character is rigged with Mixamo so the blendshapes are just used for facial.
The way you describe it sounds like your animations are controlling the blend shape values over time, but I don’t think that’s the right way to do it. This video Direct Blend Trees - Unity Learn looks like each of the animations is actually just a single keyframe with the shape at 100% so that each parameter directly controls the weight of the animation which directly controls how much the shape is applied. So to blink you would have to set the “eyes closed” parameter up to 100% over a few frames then back down to 0. If you set the smile to 50% it goes immediately to 50% and doesn’t do anything else on its own.
Good point SilentSin
I somehow thought that I could have several anim combined using direct, but instead direct is used to set a single keyframe.
I have made a blinking animation clip in the animation,and another for the mouth talking.
How can I have these playing along with another “walking” animation?
It’s to add a layer for each animation? My issue is that I have a hard time controlling that the talking should happen when the “walking” animation is running, so that’s why I thought direct would be a way to “group” animations.
Layers could be the way to go, but it’s hard to understand exactly how you’re trying to set things up from descriptions alone. Just try it and see.
How would you have set it up?
I basically just want my character to always blink and then I’m changing between a couple of facial experssions that I want to run to a specific bone animation.
ie when I’m using the mixamo animation for “saluting”, I want to run my “smiling” animation and when I run my walking, his face is neutral.
Any direction would be much appreciated
I’ve never done anything quite like this before so other than the ideas I’ve given so far, I have no idea how I’d do it with Mecanim. The constant need to find workarounds for stuff like this is one of the main reasons why I made Animancer in the first place.
With Animancer, I’d probably do something like this:
- Make two layers: base layer for all regular animations, second layer for expressions.
- On startup, create a ClipState for each of the expression clips and keep them in an array or maybe a dictionary keyed by an enum.
- Set Blink to play and never touch it again.
- Don’t use the regular AnimancerController.Play or CrossFade methods for expressions because they stop all other animations to play the new one. Instead, just control the states themselves using their IsPlaying and Weight properties or their StartFade method.
If that doesn’t do what I want I’d try making a custom AnimationMixer specifically for managing expressions.
And if that still somehow doesn’t do what I want, then I can debug my way through the system and make whatever modifications I need because I have all the source code (it’s included in the Pro version).
Edit: actually I probably wouldn’t just let Blink play on its own because blinking at a constant rate is very unnatural. I’d look up average blinking times and build a randomised timer into my control script with an additional chance to trigger it several times in a row.
Thanks for the input!
I’m really surprised that to set up an Idle and a walk animation with one facial expression for the idle and another for walk isn’t something that can be done out of the box in Unity. I would have that that.
Thanks for tip on Animancer SilentSin!