Quick Start: DeLimit Photon Networking 2
This Quick Start guide is for those of you integrating DeLimit into a game with Photon Unity Networking.
This tutorial will guide you through the steps required to get a basic DeLimit setup working in your project. By the end of this tutorial, you will having working voice Master with all users talking in a global chat room.
Before beginning this tutorial, please refer to the installation guide to learn how to install DeLimit into your project.
A demo scene for this tutorial can be found in the DeLimit/Integrations/Networking/Demo
folder.
Step 1: DeLimit Master Object
DeLimit runs mostly from a single game object, which should be placed somewhere near the root of your scene. This object contains the main "DeLimit Master" behavior, together with the Photon networking script.
To place the default DeLimit object into your scene, drag and drop the DeLimitManager
prefab from the DeLimit/Integrations/Photon
folder into your scene.
Once you have instantiated the DeLimitManager
prefab, you should have an object with two scripts attached: "DeLimitMaster" and PhotonCommsNetwork
.
Step 2: Add a DelimitVoiceBroadcastCapture
You now have a functional DeLimit Master system, but you are not yet transmitting anything.
Before you can speak to anyone, you need to add a "DelimitVoiceBroadcastCapture" script to our scene. This script can be placed anywhere, but for this tutorial, you should simply add it to the DeLimitManager game object you created in step 1.
The "DelimitVoiceBroadcastCapture" controls when the user's microphone is being transmitted to other players, and to whom the user is talking. There are many configuration options on this script to provide more advanced control of under what sitations we should be transmitting and who to, but for this tutorial simply leave the settings at default.
The default broadcast trigger configuration includes two settings of note: 1. Transmit on Voice Activation. This means DeLimit will transmit whenever it detects that the user is speaking. 2. Transmit to the 'Global' chat room.
Step 3: Add a DelimitVoiceCapture
Now you are talking into the 'Global' room automatically whenever you speak. However, you still can't hear anyone speaking. This is because you are not listening to the 'Global' room and so you are not receiving any of these transmissions.
To listen to the 'Global' room, add a "Voice DelimitVoiceCapture" to the scene. Like the "DelimitVoiceBroadcastCapture", this script can be placed anywhere, but for this tutorial you should simply add it to the DeLimitManager game object.
Again, leave this on the default configuration, which should have trigger activation disabled and be listening to the 'Global' chat room.
You're Done!
Congratulations, you have now added voice chat to your game! What to do next?