With AI Toolbox, you can chat with ChatGPT and Google Gemini within Unity. You can ask AI to explain the code, ask it for a list scripts to implement for a certain feature, an advice on game mechanics, etc. You even ask questions unrelated to Unity, just make sure to uncheck the Unity developer checkbox in the Settings foldout.

If the AI outputs any piece of code, you have an option to save it as a file in the project.

To open the Chat with AI window, go to Window ▶︎ AI Toolbox ▶︎ Chat with AI, or use the shortcut: Alt+Shift+C (Windows) or Option+Shift+C (Mac).

Chat with AI menu item

Chat with AI menu item

Once you open the chat window, you are good to ask away. You’ll see the Send a message field where you can type your message in the bottom of the window. Type your prompt and press the send button, shortcut: Ctrl+Enter (Windows) or Cmd+Return (Mac).

  • ‘Pencil’ button - Edit a previous message to make another generation attempt.
  • Copy button - Copy the AI response to clipboard.
  • Save button - Saves the code within the AI response as a file in the project. The file name is generated by AI.
  • Regenerate response - Tries generating another variation of the reply from AI to your latest prompt. If the Temperature is set to 0 in the Settings foldout menu (described below), this will generate the same response.
  • ‘Paper airplane’ button - Send the message. Shortcut: Ctrl+Enter (Windows) or Cmd+Return (Mac).
  • Settings - Expands and collapses the foldout menu revealing the settings applicable to the chat.
    • Unity developer - AI assumes a role of a Unity developer. If disabled, AI has no specific role.
    • Temperature - Controls randomness. Lower values result in less surprising answers. As the temperature approaches zero, the model will become deterministic and repetitive. Higher values result in more random answers.
    • Chatbot - Select the AI Backend to use for generating the responses in freeform chat. Currently, there are the following options: OpenAI ChatGPT, Azure ChatGPT and Google Gemini. The default chatbot is OpenAI ChatGPT. This selects the chatbot for the chat only — the chatbot used for other generation purposes (scripts, images etc) can be changed in each of those windows’ settings.
    • Model - Select the GPT model to use. This is the list of supported models by the selected chatbot. We’re constantly updating the list with new models as they are released.
      Due to limitations in Unity UI prior to 2022.1, the model selection dropdown is supported only in Unity 2022.1 and later. In earlier versions, the model selection is done in the AI Toolbox settings.

    Edit Shader with ChatGPT button

  • Clear - Clear the chat history.
  • ‘Download’ button - Export the chat history to a file.
  • GPT model (on the window footer) - Indicates which chatbot and model is being used for the chat generation.

Chat results including code explanations, how-to’s, etc largely depend on the GPT model you are using.

An example of coversation with ChatGPT (GPT4 model used)

An example of coversation with ChatGPT (GPT4 model used)

The Chat with AI window is dockable and can be placed anywhere in the Unity Editor so that you always have access to it.

  • Submit Script foldable menu is used to provide any script to the chatbot as context to the conversation. Select the script file in the File field (or drag and drop the script onto it) and either send a message with your question, or select one of the pre-defined questions using the buttons below.

Options to operate on files

Options to operate on files

  • How to write prompts opens the How to write prompts page of this documentation in your browser.
  • Discord opens AI Toolbox support Discord channel in your browser.
  • Asset Store Page opens the AI Toolbox Asset Store page in your browser.

Useful Links

Useful Links

Troubleshooting

Please check the FAQs page, where the most common issues and their solutions are described. If you still have questions, please contact us.

Comments