Animation integration

I want to add Animation Like yoga and other emotes in my project using convai and cc4 character’s so please help me how to do it

Hello @Abhishek_Pandya,

Welcome to the Convai Developer Forum!

Convai does not have any visual dependencies, so you can add animations like yoga or other emotes just as you would in a standard Unity project. Simply import your animations and modify your character’s current Animator Controller to include new states or replace existing ones like Idle or Walk. The implementation is entirely up to your project design.

We recommend checking out online resources and tutorials for additional guidance on working with animations in Unity.

Additionally, we have a video about CC4 Character Integration that might be helpful.

Feel free to reach out if you have more questions! :blush:

i did check your additional guidance video but i want to play action event of convai on button click by user so how can i do that

In this case, you don’t necessarily need to use Convai to trigger an action event on a button click. Convai generates an action response when an audio or text input is sent to the character.

For your case, you can simply create a Unity UI Button in your scene and add the desired action to the OnClick event of the button.

but i want chracter to respond like if user press the button do yoga then character will say somethings about yoga and then play animaiton

To achieve this, you can access the ActiveConvaiNPC and call the SendTextDataAsync method, passing your desired action as a parameter. Please make sure to define your custom action properly.

For more details, refer to our Action Video and documentation. If you’re only looking to play an animation, the “Dance Action” example provided in our resources will be particularly helpful.

this will work in normal case but i want this emotes to bee premium feature that only if you puchase emotes pack then only you can play it , but in this i can also type in chat and ask to perorm dance or yoga with out any purchase

Thank you for providing these details—sharing such requirements upfront helps us offer better guidance.

Unfortunately, we do not have a built-in solution to support premium features like this directly. Since this involves a custom implementation, we recommend experimenting with your own logic.

A simple approach might be to include an if condition before triggering the action to check for a purchase. However, note that the character might still respond as though it can perform the action, even if the purchase hasn’t been made.

For this type of custom functionality, you would need to handle both the action restriction and the chatbot’s response logic in your implementation.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.