Integrate voice and text chat into your project with this Building Block’s pre-made UI elements. Learn what Vivox channels are, how to connect players to them, and how to build chat and roster interfaces from the included components.
This Building Block helps you integrate Vivox into your project to connect players with voice and text chat. It can serve as a starting point for communication features in your multiplayer project, or dropped into an existing project to quickly add voice and chat throughout development.
This Building Block demonstrates how to do the following:
The Building Block includes example scenesA Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. More info
See in Glossary, UI Toolkit assets, and runtime components ready to connect players through voice and text.
Before you start, make sure you meet the following prerequisites:
Validate the Building Block is installed correctly by opening the included RosterWithVoiceAndText scene under Assets > Blocks > Vivox > Scenes.
A Vivox channel is a shared voice and text communication space that players connect to by name. Players who join the same channel name using the same Unity project credentials can hear and chat with each other. Channels are scoped to your project, the same channel name used in a different project creates an entirely separate space with no connection between them.
Channels are lightweight, they don’t require a host, dedicated server, or session, making them easy to use in any multiplayer setup.
Channels are independent of gameplay synchronization. They work alongside Netcode for GameObjectsThe fundamental object in Unity scenes, which can represent characters, props, scenery, cameras, waypoints, and more. A GameObject’s functionality is defined by the Components attached to it. More info
See in Glossary, Netcode for Entities, or any other networkingThe Unity system that enables multiplayer gaming across a computer network. More info
See in Glossary solution. A typical connection flow looks like the following:
| Scene | Description |
|---|---|
RosterWithVoiceAndText |
A combined view showing the channel join form, a live roster of connected players with speaking indicators and mute controls, and a text chat panel. Configured by default with ChatSettings_Group for a standard group voice and text channel. |
AudioDeviceSelector |
A standalone audio configuration panel for selecting input and output devices and adjusting their volumes. |
RosterWithVoiceAndTextThis scene demonstrates the core Vivox features, a live channel roster with speaking indicators and mute controls, and a text chat panel. A basic join form is included to get players into a channel during prototyping or testing. In a shipped game, replace the connection flow with your own.
ChannelRoster UXML:
ChannelName: Displays the name of the currently joined channel.PlayerCountLabel: Displays the number of participants in the channel.RosterList: Scrollable list of participants. Each entry shows the player’s display name, a speaking indicator that animates when the player is transmitting audio, and a mute toggle. The mute toggle is visible only when the local user is connected to audio.CopyChannelName: Displays and copies the current channel name so other players can join.
TextChat UXML:
MessageLog: Scrollable history of text messages sent in the channel.MessageInput: Text field for composing a message.SendButton: Sends the composed message to the channel.
JoinChannelMenu UXML (Used for prototyping and testing only):
PlayerName: Text field for the player’s display name.ChannelName: Text field for the channel name to join.JoinRoom: Joins the specified channel, handling Vivox login automatically.
Note: The roster and text chat components aren’t dependent on JoinChannelMenu. These components listen for the first active Vivox channel and populate automatically, whether that channel was already joined when the components loaded or joined afterward. You can replace or remove JoinChannelMenu entirely, and the roster and text chat continue to work with any channel your game joins through the Vivox SDK.
AudioDeviceSelector
AudioDeviceSelector has multiple settings available to manage input and output devices.
InputDeviceDropdown: Lists available microphone input devices. Selecting one sets it as the active input device.InputVolumeSlider: Adjusts microphone input volume. Uses an audio taper curve for natural-feeling control.OutputDeviceDropdown: Lists available audio output devices. Selecting one sets it as the active output device.OutputVolumeSlider: Adjusts speaker output volume. Uses an audio taper curve for natural-feeling control.Use Multiplayer Play Mode to test with multiple players directly from the Unity Editor.
Unity Services Core must be initialized before Vivox can function. Add the VivoxServiceInitializer prefabAn asset type that allows you to store a GameObject complete with components and properties. The prefab acts as a template from which you can create new object instances in the scene. More info
See in Glossary to your scene for a zero-configuration setup. The prefab includes ServicesInitialization, PlayerAuthentication, and Vivox initialization in a single GameObject. Alternatively, add ServicesInitialization and PlayerAuthentication components individually to your own initialization GameObject.
Ensure the Editor is signed in and the correct Project ID is set in Project Settings > Services. Confirm service enablement in the Unity Dashboard under Authentication and Vivox.
Verify network connectivity. Confirm Vivox is enabled and your project is linked. Check that the player display name and channel name fields are not empty.
Confirm that all clients are linked to the same Unity cloud project. Vivox channels are scoped to project credentials, the same channel name in two different projects creates two separate channels with no connection between them.
Check that the expected input and output devices are selected using the audio device selector. Ensure the application has microphone permission on the target platform.
The mute button is only shown when both the target participant and the local user are connected to audio. If the local user is connected as text-only, mute controls are hidden.
Confirm your root UXML element has the correct ChannelSettings asset set as its Data Source in the UI Builder. Refer to the Configuration section for details.