To use the Vivox Building Block, set up the following in your project:
The Vivox Building Block is designed for flexible, modular integration of voice and text communication into your Unity project.
Before any Vivox features can function make sure the following steps are already completed:
The Building Block includes a VivoxServiceInitializer prefab under Assets > Blocks > Vivox > Prefabs that handles all three steps in one drop-in GameObject.
The prefab contains the following components:
ServicesInitialization: Initializes Unity Services Core on start.PlayerAuthentication: Signs the player in anonymously once Core is ready.VivoxServiceInitializer: Waits for Core to finish, then initializes the Vivox SDK.Add the VivoxServiceInitializer prefab to your sceneA 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 for a zero-configuration setup. If your project already handles service initialization and authentication through its own flow, you can omit the prefab. The Vivox UI components will work with any initialization approach as long as all three steps complete before a channel is joined. The included scenes all leverage the VivoxServiceInitializer prefab.
A key architectural principle of the Building Block is the clear separation between visual representation and underlying data and logic.
ChannelSettings reference that is propagated to the data class.VivoxObserver, and handle logic related to channel and participant events.Channel behaviour is configured through a ChannelSettings ScriptableObject, which controls the channel type (Group or Echo) and chat capability (AudioOnly, TextOnly, or TextAndAudio). Two presets are included under Assets > Blocks > Vivox > Settings: ChatSettings_Group for standard multiplayer voice and text, and ChatSettings_Echo for loopback testing. To create a custom preset, right-click in the Project window and select Create > Services > Blocks > Vivox > ChannelSettings.
Note: Positional (3D) channels are not currently supported by this Building Block. Positional audio requires additional configuration through the Vivox SDK directly.
The preset is connected to your scene through UI Toolkit’s data binding system. In the UI Builder, select the root VisualElement of your scene’s UXML and set its Data Source to your chosen ChannelSettings asset. The settings propagate automatically to the JoinChannel component from there, no code changes needed.
You can use Unity’s Multiplayer Play Mode (MPPM) to test multiplayer games with multiple virtual playersA Unity Player that exists separately from the main Editor Player. Use a Virtual Player to test multiplayer gameplay on the same device without the need to create a build. More info
See in Glossary.
To begin testing your multiplayer functionality, install the Multiplayer Play Mode package as follows:
Unity’s Play mode uses the Main Editor PlayerThe Unity Player that exists in the main Unity Editor.
See in Glossary to test your gameplay. By adding the Multiplayer Play Mode package, you can enable up to three additional Editor instances for a total of four players to test projects with multiple players.
You must enable virtual players before you enter Play mode.
To enable additional Editor instances for Play mode, do the following: