Skip to content

Adding rotate event to AI NPC (other object)

This Add rotate event to AI NPC (other object) assembler allows your AI NPC to trigger another object in the scene to rotate. For example, when the NPC's Favor Score hits 60%, a specified object will spin around a certain axis.


  • 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

  1. Find the Add rotate event to AI NPC (other object) assembler from Asset Library and open it in the scene.

  2. In the assembler setup window, populate its basic settings:

    a Set the AI NPC to trigger the event: Choose an AI NPC in the scene to trigger the rotate event (other object). In our example, we select the AI NPC we created, Mio.

    b Select the object triggered to rotate: Choose an object in the scene to rotate when triggered. It should be different from the selected AI NPC.

    c Select the rotation axis: Specify an axis around which the selected object will spin around.

    d Set the speed of rotation: Control how quickly the triggered object rotates. Higher values result in faster rotation. Ranges from 1 to 15. Default: 10.

    e Select the trigger event: Choose one of the following events as a trigger event for the rotate event (other object):
    • 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.

    f Set triggered event name: Enter a name for the triggered event. For example, if you set the trigger to Emotion 6 and the event to Rotate, the triggered object will rotate when the NPC's favor score hits 60%.

  3. Click Assemble to start assembling this assembler. Once done, you can modify their properties in the Properties window.

Create rotate event

To edit the rotation settings, go to the triggered object's Properties window by selecting it and clicking the More button, then edit the rotation settings in the Behavior rotate pane. For more information, see Behavior rotate.

To edit the trigger event, update the properties located in the corresponding AiGameEventRelay pane. For more information on this component, see AiGameEventRelay.