Unity Package
Add the Asyntai AI chatbot to your Unity game or app
Overview
Unity is the game engine behind many mobile games, browser games and apps. The Asyntai package com.asyntai.ai-chatbot adds a chat button to your game. One tap opens your AI chatbot, so players get answers about your game, your shop and your support pages without leaving to search.
The assistant answers from your own website, help pages and documents, in more than 80 languages, day and night.
Requirements
- Unity 2021.3 or later
- Android: the chat opens full screen inside the game. Android 6.0 or later
- WebGL: the normal Asyntai chat widget opens on the web page next to the game
- iOS, Windows, macOS and Linux: the chat opens in the default browser
- The Android and browser chat use the full-screen chat page, which is part of the Starter, Standard and Pro plans. The WebGL widget works on every plan
Installation
Follow these steps to add Asyntai to your Unity project:
Get Your Widget ID
Sign in to Asyntai and open the Install page. The widget ID is the value of data-asyntai-id in the snippet shown there. It starts with asyntai_.
Add the Package
Get Asyntai AI Chatbot from the Unity Asset Store, or open Window > Package Manager, select + > Install package from git URL and paste:
https://github.com/asyntai/unity-ai-chatbot.git
Add the Chat Button
Add a UI Button to your Canvas. Then select Add Component > Asyntai > AI Chatbot Button and paste your widget ID. No code is needed.
Build and Play
Tap the button. On Android the chat opens on a full screen with a close button. The package adds the internet permission to Android builds for you.
Open the Chat From Code
Call it from your own menu, pause screen or support button:
using Asyntai.AIChatbot;
AsyntaiChat.Open("asyntai_1a2b3c4d5e6f"); // in the game where possible
AsyntaiChat.Open("asyntai_1a2b3c4d5e6f", "Help"); // with a title on Android
AsyntaiChat.OpenInBrowser("asyntai_1a2b3c4d5e6f"); // always in the browser
AsyntaiChat.Close();
For a WebGL game, show the chat bubble on the web page next to the game:
AsyntaiChat.ShowWidget("asyntai_1a2b3c4d5e6f");
A wrong widget ID throws an ArgumentException with a message that says how to fix it.
Component Options
| Option | Default | What it does |
|---|---|---|
| Widget ID | empty | Your Asyntai widget ID |
| Title | Chat | The title above the chat on Android |
| Show Widget On WebGL | off | Also shows the chat bubble on the web page around a WebGL game |
How It Works
On Android the package shows your Asyntai chat in a web view over the game. Links in answers to other websites, email addresses and phone numbers open in the matching app, so the conversation is still there when the player comes back. On WebGL the package loads the same chat widget that you use on your website.
Answering From Your Content
Asyntai reads your published pages. Add your site URL in the dashboard, and the assistant answers from them. You can also add documents, patch notes, and question and answer pairs.
Tip: Change the colours, the welcome message and the AI instructions in the Asyntai dashboard. The change shows in your game at once, with no new build.
Sample
In the Package Manager, open the package and import the Chat Button sample. Add ChatButtonSample to an empty GameObject, set your widget ID and press Play. It creates a chat button in the bottom right corner.
Removing It
Remove the package in the Package Manager and delete the chat button components from your scenes.
Plans & Pricing
The package is free. The full-screen chat for Android and the browser is part of the Starter, Standard and Pro plans. View pricing.
Need Help?
If you have any questions or run into issues, contact us at [email protected].