Forum rules - please read before posting.

Transitions between Expressions

Hello there!
I was looking into the forum without luck, so here I am opening a new thread.
Basically I can't set properly a character mechanim expression through my animator and AC.
I've a set with 4 expressions per character. My characters are 3D models and the 4 "expressions" are actually different "talking" animation with different postures (for instance the "Sad" expression not only has a sad face, but also face looking down, arms along the body, etc. while the "Happy" might have the arms up). So I'm not using blend shapes or anything like that, they are totally different animations, one per expression.
To achieve this I've created a Blend State for my Talking animator (the one triggered by IsTalking? true), in which I have the 4 sub-talking animations triggered by a float value called expression (which is converted from the regular integer expressions via script). It works kind of ok...
The problem is: there are no smooth transitions between the states, especially when the player skip a dialogue. For instance: a character is talking with the "Sad" expression, then it's time to play the next line, which is "Normal", and he/she suddenly snap to "Normal" expression, without a smooth transition from "Sad", making everything snappy and ugly.
So... am I doing something wrong with my Animator? Maybe I shouldn't rely on the Blend State for the "Talking"? But having multiple individual States, one for each expression, that are all connected to the idle and all connected each other?
Or is there a way with AC to handle the Blend State for smoother transitions between different expressions?
Thanks a lot!


  • edited September 2020

    If you were transitioning between states, as opposed to wrapping everything in a Blend Tree, then you could extend the "Transition time" to smooth things out.

    But as you're converting the original Expression ID integer parameter to your own float parameter anyway, you can just modify the script to lerp the final value instead.

    i.e. instead of:

    myFloat = (float) myInt;


    myFloat = Mathf.Lerp (myFloat, (float) myInt, Time.deltaTime * speed);
  • Sorry I'm back to this... In September I didn't manage to make it work. So I'm trying again today, without luck.
    The question is: if we go for a Mathf.Lerp and deltaTime, isn't the float of my expressions changing going through the others?
    My expressions are: 0 is the Standard, 1 is Happy, 2 is Angry and 3 is Sad, if we lerp between Standard and Sad, it'll mean the float will go also through Happy and Angry. Am I right? Therefore won't work...
    Is there any other solution? Or should I give up the idea of using a Blend Tree for expressions?

  • 0 is the Standard, 1 is Happy, 2 is Angry and 3 is Sad, if we lerp between Standard and Sad, it'll mean the float will go also through Happy and Angry.

    If it's a 1D Blend Tree, that's correct.

    Being able to control different expressions individually would involve making a Direct Blend Tree, but that's more intended for animating different expression parts (e.g. mouth, brows) separately.

    If your animations control the whole body, and you only have four, I'd say you're best off using a sub-state machine and create your transitions manually.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.