Since we shift from Convai to ChatGPT system, the method for facial expression mainly has two sections.
Section 1: Define face expressions with animation
Since using scriptable object to store face expression need an extra method to aviod reset facial changes while switching face expression. This time I used a blend tree (2D Freeform Directional) to set up as animations. And I design a two levels for Happy and Sad from low to high
And it can switch easily as the coordinate (x,y) changes.
Section 2: Define AI response with emotions
First, in the prompt I let ChatGPT to give every response a emotion state with [Happy_low]
So that I have the response text as input value, so next to do is to define the expression for different keywords. I use the method as a swith case. Here is the script.
Default face expression
Break down sentence and emotion as different input text value
Animation switch case (Switching facial expression)
Define emotion text variable
From now I finally set up the facial expression swith as the emotion with its response for our AI chat section. And using animation clip is better that scirptable object since it has transitions making the character more human like.
Final Face Expression system update.