Hello!
I'm trying to use mecanim expressions, but I'm not getting results. To be concrete: I've checked "Use expressions?", and I've given Expression #0 the name "Laughter" and Expression #1 the name "Anger". I've set Expression ID integer to "Expression" and created a parameter in my animator controller named "Expression". My assumption is then that a line like "[expression:Anger]To be or not to be. [expression:Laughter]That is the question." would set the parameter "Expression" to value 1 at the beginning then to value 0 in the middle.
Instead, I'm not observing the expression tags to have any effect on the parameter. The parameter is set to 0 upon beginning any dialog, whether or not it has tags. In dialogues with expression tags, the tag behaves as "[wait]" is documented to behave. Any ideas on this double misbehavior? (It seemed odd that I didn't have to set anything inside the "Mecanim parameters" section of my player)
Cheers and thank you!
Comments
As for the main issue, this looks like a bug. Not clear if it's a result of Unity updates yet, but I will address it for v1.51. Thanks for the report.
I don't know if you're script-inclined and don't mind debugging, but the Char script function GetExpressionID (string expressionLabel) is what converts the expression tag into an ID number.
tl;dr is that if you have multiple expressions in a line, only the final one is used. Because I was ending every line with returning the character to the default expression, only the default expression was every seen.
Is this a bug? It doesn't seem like it would be expected behavior? What's the expected way to have different emotions during a line, or even to go back to the default expression after a line?
Really appreciate the help!
If you want to make use of per-character processing without the visible effect of scrolling, you'll want to grab the upcoming v1.51 update. It will provide event listeners for (amongst other things) speech initialisation - so you could feasibly write a very simple script that displays your own Label / UI Text component will the full speech text, rather than AC's one which will scroll one character at a time.