Voicechat
The voicechat system allows players to communicate with each other using their microphone.
The SDK offers a variety of methods to control the voicechat system, from walkie-talkie style to proximity-based voicechat or a combination of both.
Modes
The voicechat system supports two modes: global
and proximity
Mode | Description |
---|---|
global | All players can hear each other regardless of their distance. |
proximity | Players can only hear each other if they are close enough based on the distance setting. |
Channels
By default, all players are in the same voicechat channel 0
.
You can enable and disable different channels by using the player.enableChannel and player.disableChannel methods respectively.
Global and Per Player settings
The voicechat system can be controlled globally or per player.
When using a player method, the global setting will be overridden for that player.
If the voicechat is disabled globally using voicechat.setEnabled, you can't enable it for a specific player. To achieve this, you can use the player.voicechat.setMuted or removing the player from all (or specific) channels using player.voicechat.disableChannel.
Setting | Description |
---|---|
voicechat.setEnabled | Sets the global voicechat status. |
voicechat.setMode | Sets the global voicechat mode. |
voicechat.setDistance | Sets the global voicechat distance. |
player.voicechat.setPlayerToPlayerMode | Sets the voicechat mode to player to player. |
player.voicechat.enableChannel | Enables a voicechat channel. |
player.voicechat.disableChannel | Disables a voicechat channel. |
player.voicechat.setMuted | Sets the player's muted status. |
player.voicechat.setDistance | Sets the player's voicechat distance. |
Server settings
Basic configuration of the voicechat system like the global VoicechatModeType, distance
and status
can be done in the Communication
tab of the Server Settings
.
Mute Players
A player can be muted for all players using the player.voicechat.setMuted method.
At the same time local players can mute other players from the players list by clicking on the speaker icon: