Skip to main content

Running the Project

Setting up the Environment

Navigate to Config/DefaultEngine.ini in your project directory, and add the following lines:

[Voice]
bEnabled=true

[/Script/InworldAIIntegration.InworldApiSubsystem]
AuthUrl=api-studio.inworld.ai
TargetUrl=api-engine.inworld.ai:443
ApiKey=ryBJ1L9rz86eSE2hhXqXCSNaPVF1111
ApiSecret=a1Vax6gYM4x5PimP2ANNPY1KFa5K1AQTsNBqG2cPIQz8aZoWvD4bD4luo111111

Put the correct API Key and API Secret that you generated on the integrations page of the studio.

Setting up a Scene in Unreal Editor

⚠️ Note: Ensure that you have put a valid scene name corresponding to your workspace.

  1. Open your map in the Unreal Editor
  2. Open the Level Blueprint
  3. Implement the starting Inworld Session

Screen

⚠️ Note: A delay is needed to ensure that the standard player and character components are registered in the InworldSubsystem.

Next, you will need to open your player pawn blueprint and add the InworldPlayer component.

Screen

Change Interaction Distance and Interaction Dot Threshold in the InworldPlayer component settings if needed.

Screen

To be able to use the microphone and speak to your characters, you will need to add an AudioCapture component.

Screen

We need to prevent sound from your microphone going through to your speaker. To do this, create a new Sound Submix in the Content Browser.

Screen

In the new submix, set the volume to minimum.

⚠️ Note: In UE5, the minimum output volume value -96, not 0.

Screen

Set the new submix as the Base Submix in the audio capture component on your pawn.

Screen

Create an actor blueprint and open it. Add the InworldCharacter component.

Screen

Put the code for your character under the Brain Name field in the settings for the character component. Add an audio component so that the character can speak to you.

Screen

Add your character actor to the map.

Running a Game Session

With the setup above, you should be able to approach your character and have a discussion using your microphone. No buttons or any other triggers are needed to begin the interaction, since the character will be activated by proximity in the InworldPlayer component. Use the LogInworld category of the output log to see what is happening.

Screen

⚠️ Note: If you come up to the character and the interaction has not started, check that the Interaction Distance setting in the InworldPlayer component is not too short. Try setting the Interaction dot threshold to -1 to disable the interaction dependency on player camera direction.

⚠️ Note: There is an issue with First Person and Third Person template projects in UE4 and UE5. Components you have added to the FirstPersonCharacter and ThirdPersonCharacter can be reset after an engine restart. Be sure that your InworldPlayer and AudioCapture components are set up properly before beginning the game.

⚠️ Note: The standard InworldPlayer component uses the UAudioMixerBlueprintLibrary to record audio every 100ms. In doing so, it may generate logging information and warnings that cannot be disabled on each recorded audio chunk. You may want to disable the LogAudio and LogAudioDerivedData output log filter categories during your audio sessions to avoid spamming to logs.