Integrating Inworld with Unity: Getting Started

Unity is a huge force in game development, having long supported everything from indie game studios to massive Fortune 500 companies. In 2021, 94 out of the top 100 game development studios (based on revenue) were using Unity.

Inworld provides an easy way to build revolutionary, AI-powered interactive experiences that work within Unity. We’re a Unity Verified Solutions Partner, so once you’ve created your characters in Inworld Studio, you can drag and drop directly into your Unity project.

With the enormous breadth of experiences you can create with Unity, we’re certain that Inworld can help bring them to life in ways you never imagined.

You can access our Unity Verified Partner Solution directly from our developer docs, which cover:

  • Compatibility
  • Prerequisites
  • Getting started
  • Inworld editor
  • Creating your own character
  • Animations
  • Lip syncing
  • Head and eye movement
  • Legacy integrations
  • And more!

We also created a video tutorial to walk you through how to integrate your Inworld AI characters into your Unity experiences, which you can watch below.

If you have any follow-ups on the tutorial video, leave a reply below. If you have questions about integrating Inworld in Unity in general, please post another topic here in the Integrating category and add the #Unity tag.

7 Likes


Hi, I am having trouble login into inworld in unity. It can't download properly, always stuck at 0%. And there is an error information showing Invalid Operation Exception. Could you help with this? Thank you

Hey Alina,

We're very sorry for your experience.
Would you please provide us more informations?

Which OS are you using?
If you're using Mac M1, but downloaded the package from Unity Asset Store, we recommend you download our package from https://storage.googleapis.com/assets-inworld-ai/unity-packages/InworldAI_latest.unitypackage

Also here's the tutorial about how to enable Inworld in Mac:

Because we just implemented M1 Support, and still waiting Unity's approval to update.

If you're not using M1, would you please share us detailed error? You could switch to console and double click the error information, then it'll show case the stacktrace.

Hi Yanjin,

Yes I am using a Mac M1, and it works with the package you provided! Thank you very much! May I know by using the player control, how can I constrain the vertical movement of the player? I want the player to keep the same eye level all the time. May I know what I should do? Thank you for your help!

Best,
Alina

Hey Alina,

We just use Unity's default SimpleCameraController.cs for play movements. So if you want to fix the vertical-y movement, you could just comment the line 158 of SampleCameraController.cs

Hi Yanjin, thank you, it helps me a lot:)

Another question I have is after I built the project, I can't use the microphone to give voice input in the game. I tried using the ~ button, and type text in the text panel. But my character does not respond to me. Everything works perfectly fine in the game mode in unity. Is there anything I should do when I build the game?

Hey Alina,

Sorry for the inconvenience. Which platform are you building for? Some platform needs you to open the microphone permission.

If you are building Mac standalone application, it may not work because a Unity Bug Unity Issue Tracker - [macOS] Build fails with command failing to write to output file when using 3rd party plugin (unity3d.com) which would be fixed in 2022.2.X

Hi Yan Jin,

Yes I was trying to build a Mac application and it didn't work. So I switched to WebGL instead. But there were some errors about the microphone when building the game and it eventually failed. Could you take a look at this?

Hey Alina,

Sorry for the inconvenience. WebGL is not supported to our bi-directional network protocol.

We're very sorry that the compatibility pages on both documentation and the description on Unity Asset Store are still outdated.

If you'd like to try building the application, you can try Windows and Android, which is much easier.

For some reason, I can start a conversation with an InworldCharacter, but can't continue it. I just get spammed with errors.

Starting the conversation like so:

            var character = InworldController.Instance.Characters[0];
            character.SendText($"{text}");

and that works fine.

But when I submit my own text afterward in the same way, I get flooded with the following errors:

RpcException: Status(StatusCode="InvalidArgument", Detail="Target agent id is required for incoming (for server) event routing", DebugException="Grpc.Core.Internal.CoreErrorDetailException: {"created":"@1673296297.003000000","description":"Error received from peer ipv4:34.120.166.226:443","file":"..\..\..\src\core\lib\surface\call.cc","file_line":953,"grpc_message":"Target agent id is required for incoming (for server) event routing","grpc_status":3}")
Grpc.Core.Internal.ClientResponseStream`2[TRequest,TResponse].MoveNext (System.Threading.CancellationToken token) (at <8f0b2e122df241568ff1c1cc667a96e5>:0)
Inworld.InworldClient+<>c__DisplayClass35_0.<StartSession>b__0 () (at Assets/Inworld.AI/Scripts/Runtime/Entities/InworldClient.cs:236)
Inworld.InworldClient.StartSession () (at Assets/Inworld.AI/Scripts/Runtime/Entities/InworldClient.cs:305)
UnityEngine.Debug:LogException(Exception)
Inworld.<InteractionCoroutine>d__58:MoveNext() (at Assets/Inworld.AI/Scripts/Runtime/Entities/InworldController.cs:338)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

Any help would be appreciated.

Hi Yanjin,

I use apple M1, and I have tried several versions of unity with both SDK package from the unity asset store and inworld official website. but it still cannot be connected.(it shows a low ping but always being initializing. )By the way, I can go through the functions on the website.

Hey Liam, Sorry I didn't notice that you also ask the support here. We've fixed the issue in Discord channel. Really thank you for your support.

Hi Jie,

Sorry for your inconvenience, I'm not sure what your exact issue is, but here are several tips:

  1. Our minimum version of Unity is 2021.3.2f1, any version below that may not work.
  2. If you're using Mac, it'll automatically delete our core library because of the unauthentication issues. Please check Compatibility | Inworld AI for more info.
  3. If the grpc runtime bundle survived, you can check the SampleConnection scene, and print out the log if connecting is not successful. (We do have a back-off reconnect system to keep trying reconnecting)

hello, can someone help me, i cant talk to my inworld character

Hi @saintepord, can you start a new thread in the #feedback section or alternatively, drop an email to support@inworld.ai with more information? We'll be glad to help. You can also check out our Discord.

1 Like

can this build and run in oculus quest 2 using unity?

Hey @saintepord, we have an Oculus companion app that we can get you access to that would help with that. Send an email to support@inworld and tell us the email associated with your Oculus/Quest acct.

Hello Stephen,

I am trying to figure out how to best deliver my game to my clients. I am on a Mac and would like to build for a WebGL, but it sounds like neither of those are supported. My plan is to now use Unity's DevOp Cloud Builder. However, I'm not sure what is possible for the final deliverable format. I need to be able to build something for my clients (less tech-savvy individuals) that is browser based or some other easily accessible means. Can you send me in the right direction for this?
thanks,
Jonathan