How to setup an Embodiment Agent¶
Agent Initialization¶
An agent can be initialized inside a step, by running the command:
Hub.Instance.Get<EmbodimentJARIAModule>().InitializeAgent(index);
Index is the index of the agent inside in the module list.
Important
Agents have four events exposed that can be configured as you desire:
OnStartTalking: Invoked when the first audio clip has produced.
OnEndTalking: Invoked when all the audio clips have been played.
OnInteract: Invoked when the interact button is clicked.
OnCancel: Invoked when the cancel button is clicked.
Agent Interaction¶
Important
In order to interact with the agent, the Speech SDK needs to be installed first.
You can install the Speech SDK through the mages panel, located inside the configuration section.
Note
In order the agent to play animations and to follow the player, the animation rigging package needs to be installed first. But agent can alsoo be used, without this package installed.
You can install the animation rigging package through the mages panel, located inside the configuration section.
If the embodiment character has a character controller component attached, then the character can have animations during speacking and gaze towards the user.
Example code can be found inside the step that initializes the agent, in the neuromonitoring sample scene.
If an agent is added inside the agent’s list of the component and correctly configured, an interact button will be spawned above the embodiment character.

2. After the click, both the user input and agent output components will become visible. The user input will display the recognized text until the final user input is recognized. The text handler will convert the response into both a voice clip and text. The sutitles will be displayed by the agent output component, while the voice will be played in sync with the subtitles.

After completing the response, the user will have the option to either speak again or press cancel to stop the agent.
Note
Multiple Agents Interaction
Multiple embodiment agents can be added in a scene, and interacte with them.
Each agent must have their own interaction and output component.
Each agent must be initialized independently.

Agent Interaction during coop
The embodiment agent can be used in a coop session by the users.
The interaction buttons of the agent are handled synchronously, ensuring that they can only be used by one user at a time.
The agent output (voice & sutitles) are sycnhronized across users.
