How to Play Animation with Open AI NPC Freeform Chat

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Mchaint
Posts: 7
Joined: Sun Mar 03, 2024 9:16 pm

How to Play Animation with Open AI NPC Freeform Chat

Post by Mchaint »

Hi Tony,
I am currently developing a VR game, I am trying to make the AI NPC to Play certain Animation during freeform conversation, for example, if Player asks "Can you show me how to dance?" then AI NPC plays dance animation.
Also, if Player asks "Can you pick up that Gun for me?" then AI NPC picks up the gun and give it to the Player by playing that pick up animation.

Image

I thought I need to use Variables and Boolean, but I don't know where to write the sequencer command "AnimatorPlay" for this scenario.
Please guide me how to make this happen.
Thank you so much :)
User avatar
Tony Li
Posts: 22112
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to Play Animation with Open AI NPC Freeform Chat

Post by Tony Li »

This is something that even the AAA studios are still figuring out. I assume you're using the Dialogue System Addon for OpenAI's RuntimeAIConversation component. If so, one idea is to additionally specify something like "If the player asks {NPC} to perform an action, print that action in square brackets such as [dance]." You could add it to the Topic field. Then make a subclass of RuntimeAIConversation and override the OnReceivedLine() method to look for text that contains square brackets. It may take some experimentation to arrive at a prompt that returns what you want.
Mchaint
Posts: 7
Joined: Sun Mar 03, 2024 9:16 pm

Re: How to Play Animation with Open AI NPC Freeform Chat

Post by Mchaint »

Oops, ok, haha, I saw this Convai AI Asset on Unity Asset store, in the video, AI-NPC picking up the rifle and hand it to the player,
so I thought it is something I can also do with dialogue system OpenAI Addons.
https://assetstore.unity.com/packages/t ... vai-235621

This is their video

User avatar
Tony Li
Posts: 22112
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to Play Animation with Open AI NPC Freeform Chat

Post by Tony Li »

Yeah, some of those things are very bespoke. It's possible, but like with Convai you need to do a bit of setup.
Post Reply