Page 1 of 1

How to Play Animation with Open AI NPC Freeform Chat

Posted: Sun Mar 03, 2024 9:29 pm
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 :)

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

Posted: Sun Mar 03, 2024 10:00 pm
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.

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

Posted: Sun Mar 03, 2024 10:35 pm
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


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

Posted: Mon Mar 04, 2024 9:27 am
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.