Adding animation event to AI NPC¶
This Add animation event to AI NPC assembler allows you to animate a configured AI APC when triggered. For example, you can enable the AI NPC to perform a specific action when her favor score hits 60%.
Prerequisites¶
-
YAHAHA Studio version 0.3.66 or later
-
An AI NPC, created using the Create an AI NPC assembler and placed in the scene Visual Studio Code is installed and integrated with your Studio.
Set up the assembler¶
-
Find a desired animation clip in Asset Library by navigating to Collections by YAHAHA>AI Game Jam>Animation and add it to your assets. This audio will animation when triggered. In our case, we add excited_excited, a playful animation with a character's hands and feet making light, nimble movements.
-
Find the Add animation event to AI NPC assembler from Asset Library and open it in the scene.
-
In the assembler setup window, populate its basic settings:
a Set the AI NPC to play animation: Select the NPC in the scene to trigger the animation event. In our example, we select the AI NPC we created, Mio.b Select the animation file to play: Select the desired animation clip to play when triggered. We choose the added animation clip from the first step.c Select the trigger event: Choose one of the following events as a trigger event for the animation event:- Emotion 1-10 represents the AI NPC's favor score, ranging from 10% to 100%. It reflects the NPC's contentment level, with 10 being the least content and 100 being the most content.
- Chat Win indicates that the player wins the chat interaction with the AI NPC.
- Chat Lose indicates when the player loses the chat interaction with the AI NPC.
d Set the trigger event name: Enter a name for the triggered event. For example, if we set the trigger to Emotion 6 and the event to Excited, when the NPC's favor score hits 60%, this NPC will start to make quick, nimble movements. -
Click Assemble to start assembling this assembler. Once done, you can modify their properties in the Properties window.
Edit event-related properties¶
To edit the animation settings, go to the NPC's Properties window by clicking the More button and modify them in the Animation player pane. For more information, see Animation player.