Main

Unity all steps tutorial : Vivox in-game voice chat

💬 Turn on [CC] to translate to any Languages [JP/FR/GR/EN/VI/CN/KR/ES... all supported] ⭐ This Video : How to create social app or in game voice & text chat with Unity Vivox in Visual Scripting . Install plugins . Step 1 Initialize . Create Buttons . Step 2 Sign in . Step 3 Join in channel . Button Leave Channel . Join in group channel . Who joined in . Create group users . On user joined . Toggle on value changed .Mute mic . Test mute mic . On User Speaking . Send receive message in channel . What Vivox can do === 🍀 New in Unity ? Dont know how to code ... Dont worry Learning Path for you : 🐾 Level 1 : Learn Unity basic in 2D game - For Beginner (all script and resource are FREE ) : https://youtube.com/playlist?list=PLcNb7VR72tXP1Mqcd-vXnn_F6MJE-bbCP 🐾 Level 2 : Learn Unity basic in 3D game - All videos (all script and resource are FREE ) : https://youtube.com/playlist?list=PLcNb7VR72tXM_3eXrVMxutYa4E-YIJnOa&si=V4VL3VWB4ASR-bsW 🐾 Level 3 : Learn Unity basic 3rd Person game or 1st Person game (all script and resource are FREE ) : https://youtube.com/playlist?list=PLcNb7VR72tXOeGUBznVOPlJ60zQCMesIN 🐾 Level 4 : Learn to use C# in Visual Scripting : https://youtube.com/playlist?list=PLcNb7VR72tXOSmzBsUsWCNizzWKmdyxR7&si=lioHEIv1GTsrI-gC ( videos explain all basic C# code soon... ) 🐾 Level 5 : Make Multiplayer Online game with Netcode in Visual Scripting : https://youtube.com/playlist?list=PLLYnL37vQ02SYU-N_VpHrhG87qjlNhlPl&si=no4cIUPr8uqinAuM ===== 🔥 Download Visual Scripting Plus from Unity Asset Store to support me: https://assetstore.unity.com/packages/slug/219926 ===== 🏂 Any questions about Unity or Visual Scripting : https://discord.gg/MsmQ64rX9y ( me @Leo69 ) Follow me at : - Instagram: https://www.instagram.com/leonnguyen0609/ - TikTok: https://www.tiktok.com/@leonng_333 - Twitter : @unitynocode - Fb : unitynocode #madewithunity #visualscripting #gamedev #gamedevelopment #nocode #unitynocode ===== Chapters 0:00 - Intro 0:33 - Install plugins 3:04 - Step 1 Initialize 4:36 - Create Buttons 5:45 - Step 2 Sign in 6:49 - Step 3 Join in channel 8:23 - Button Leave Channel 9:29 - Join in group channel 10:58 - Who joined in 11:17 - Create group users 13:03 - On user joined 16:01 - Toggle on value changed 20:55 - Mute mic 23:12 - Test mute mic 23:53 - On User Speaking 24:57 - Send receive message in channel 26:51 - What Vivox can do

Unity No Code | Leo N

7 days ago

In this video : Learn how to use Vivox text & in-game voice chat 1 node only , you can join in channel and can hear your friends speaking with many users as you want, can join in your channel You can mute your microphone anytime or mute any users you don't want to hear his voice Easily send message or recieve message in your channel Anything Discord can do ... you can do it in Vivox too ! Tittle : Install plugins After you created a new project in Unity Go to "Package Manager" You will need plug
in "Visual Scripting Plus" make sure you update it to the newest version then import everything into your project Or you can open, and import only "Macro - Chat Vivox" After all, you will have folder "Macro-ChatVivox" right here double-click this file to see How to use First : you need to install plugin "Vivox" with version 16.0.1 or newer version then open Package Manager again Next : add new package by name type the version you want install here then click button "Add" "Vivox" is installed su
ccessfully It requires plugin "Authentication" to sign in Unity Service so we copy its name to install it too it will be version 3.3.0 or newer install plugin "Authentication" ... version 3.3.0 Now we already have all plugins we need ! Before to start it : you need to add Unity Service Project ID into your unity You will do it in "Project Settings" Select "Services" Select your name ... then add project Id or create new one if don't have it yet New Unity Service Project ID was added ... If you s
ee this, so Vivox was added and ready to use Next step : unzip file [Macro-ChatVivox] and restart after all Open this file in explorer unzip it This is folder has all events of Vivox You need to restart Unity for all scripts to be loaded restart it Everything is ready to use now. Tittle : Step 1. Initialize Open folder "Macro-ChatVivox" open script "Use-ChatVivox" to see see how to use it These are all events of plugin Vivox and we have instruction "How to use" here First : after installed plugi
n Vivox ... you need to add prefab "Macro-ChatVivox" into Hierarchy add this prefab into ... At Step 1: We need to [Initialize Vivox] to start service Vivox It is marked as step 1,2,3 ... very easy to follow Copy event [Initialize Vivox] Let's create a new Empty Object name it "Vivox Manager" then add new Visual Scripting script name it with any names you like open it Let's initialize Vivox at [On Start] After "Vivox Service" is initialized and ready. Output "Success" will trigger Print out a me
ssage to Debug.Log to tell that "Vivox is intialized" Now press Play to see how it works After game is started ... Vivox will be initialized It works... Tittle : Create Buttons Let's create some Buttons Remember to set Canvas screen size this will fix wrong position of Buttons on bigger screen rename it to "Button Sign In" with size 300 x 100 pixel make text bigger and move it to left side of the screen copy to create another Button Sign Out Button Join In Button Leave Channel and Button Mute to
mute your microphone Next : Let's add Button Click events use "On Pointer Down" for Click down [This] is Button is clicked on Let's add "Button Sign In" into If Button is clicked on, let's print out a message to Debug Log Press Play and test it click Button Sign In It works Tittle : Step 2.Sign in After Vivox is initialized Player can [Sign In] to log in and get his User ID copy event [Sign in] open Vivox Manager We will call event [Sign In] right after "Button Sign In" is clicked Enter "Player
Name" into Press Play to test it After Vivox is initialized ... click "Button Sign In" It will take awhile ... then it is signed in successfully You will have User ID here When user is signed in successfully, it will be counted on Unity Server You are free to use Vivox if there are less than 5000 users at same time If over this number, you will be charged it This price is acceptable... because you have a big amount of Players now Tittle : Step 3. Join Channel After signed in ... You will need t
o call event [Join in Channel] to join in and it will connect you with other people in that channel This event to "Join in a group Channel" When you joined in, you can hear people talking and their text chat And this one is a test channel. You can hear your voice only to test your mic Let's join in a Test Channel first to see if your Microphone is working ... open our script paste it here Create another Button Click event We already have "Button Join In" here Add its name into After Button Join
is clicked, we will join in a Test Channel If it is successfully , this will be triggered print out a message to Debug Log Press Play to see how it works After Vivox service is ready , click Button Sign in Signed in successfully Now click Button Join In We will join in a Test Channel Test Channel will have name is "Mic" to test your microphone If you connected a microphone into, you can hear your voice [My name is Leo ... This is a test channel] Tittle : Button Leave Channel Open "Use-ChatVivox"
again We will "Join in a group channel" later... Now let's see how to "Leave Channel" ... You have to "Leave Current Channel" before you join in Another Channel Open our script Paste copied event into Create another Button Click event for "Button Leave" Output "Success" will trigger if you left the current channel Print out a message to Debug Log "You left channel !" Press Play to test it Click Sign in after signed in successfully ... join in a channel You joined in a channel successfully. Now
press "Button Leave Channel" It works... You has left the current channel ! Tittle : Join in Group Channel In test channel, you can not hear your friends voice To be able to hear your Friends, we need to use this event [Join in Channel] Copy it ! At Button Join In ... Replace it with our new event [Join in Channel] Enter name of channel you want to join in ... without white space You can Text in this channel , or Voice only or both Text and Voice After joined in successfully, this one will be t
riggered Press Play to test it ! Sign in After signed in successfully ... click Button Join In As you see : I have joined in channel Room 1 with name "Leo1" Now copy all the scripts to another computer to test 2nd Player Do the same thing, after signed in , press Join in channel Player "Leo2" has joined in channel Room1 as well ... On PC 1 : it showed that another Player has joined in also [Hello... I am Leo2 ... I'm speaking on PC 2] [and this is Leo1 ... I'm talking on PC 1] Tittle : Who Joine
d in ? In most of online games ... when a Player joined in , it will show his name like this and another Player joined and you can be able turn off your microphone or turn off your friend voice to not hear from him any more Tittle : Create Group Users First : Let's create a Toggle to turn on or off the microphone name it "User Mic" make it bigger size I will remove the Label text If you press Play, you can turn this On or Off easily Next : Create some Text to display User ID You will need User I
D later to turn off his voice with size 300 x 100 pixel font size 40 ... and white color text make it center next : copy to create another Text for User Name move it to the right side Now group all of User infomation ... name it "User" name it "User" If you have many users joined in ... it will be duplicated like this If you have many users joined in ... it will be duplicated like this You can have as many users as you want now But the spacing between them are not aligned yet Let's group these U
sers again and name it "Current Users" Add component "Vertical Layout Group" Adjust the spacing between lines You can move all of them anywhere you want easily now make sure you turned off option "Child Force Expand" the spacing can not be changed automatically any more You can create as many users as you want right now and the spacing between them always perfect Delete all and just keep only 1 object "User" Tittle : On User Joined When nobody in channel , let's turn off all object "User" In "Vi
vox Manager" , let's put object "Current Users" and "User" in variables so we can call them easily later add both objects "Current Users" and "User" Whenever a new user joined in channel, this event will trigger copy it ! open Vivox Manager script paste it here When new user joined in ... we will create a new object "User" to show his user ID and his name add object [User] to create a new one and new object "User" should be inside group "Current Users" add new object "User" into a variable to ca
ll it easier Now let's add User ID , User Name into this new user ... we already create an object "User" use "Get Child" to get each object inside it User ID will be the Child with index 1 add text User ID to this new user do same thing to add User Name User Name will be the Child with index 2 add "User Name" into this Text New object User will be in-active like this so we need to turn it "Active" for people can see it Press Play to test it Signed in ... then press Button Join In when new user j
oined in channel : new object "User" will be created and you can know what is "User ID" of this joined user and his "User Name" as well Next : If you click on this button, you will mute the mic of this user and you can not hear this user voice any more... Tittle : Toggle : On Value Changed Let's turn on object User on to test it when "User Mic" is clicked on ... value "is On" will be changed when this value changed, it will trigger event "On Value Changed" here You can send its value to any Visu
al Scripting script ... with this Plus icon Let's create a new Visual Scripting script inside this Toggle object name it with any names you like now on Toggle "On Value Changed" ... click Plus icon this option can send the value to any object you want Let's send Toggle value to its self object "User Mic" On tab function ... you see option "Script machine" for visual scripting script Select "Trigger Unity Event" then you can enter the name of "Unity Event" here ... "Trigger Unity Event" is a node
that you can add in any visual scripting script Let's type the name of "Unity Event" that you want it to trigger copy this name and open the script again paste the name into whenever the Toggle value is changed ... this UnityEvent will trigger Let's print out value of Toggle "User Mic" to test it We can get value of User Mic, User ID, User Name at the same time Our script is inside "User Mic" object ... let's get object "User" parent of it after you have object "User" ... you can get object "Us
er ID" easily with event "Get Child" "User ID" is Child of "User" with index is 1 Let's print out value Text of this User ID Do same thing to get "User Name" "User Name" is Child of "User" with index is 2 Lastly : let's get value of toggle "User Mic" Value of Toggle is value of "Is On" print out value of Toggle "User Mic" Press Play to test it click on button toggle "User Mic" to change its value when User Mic has changed ... you can know which user id and user name whenever it is turned on or o
ff ... it will trigger as well Next step : let's send these values to "Vivox Manager" add object "Vivox Manager" into a variable of this toggle User Mic and open its script again Let's send these values of User to Vivox Manager name it "Mute User Changed" We have 3 values need to send to First is : User ID Second is : User Name and value of toggle "User Mic" It will send values to "Custom Event" with same name ... Move this event to Vivox Manager Now whenever a "User Mic" is clicked on ... This
Custom Event will be triggered And you can know microphone of which User is clicked on... You can turn off the sample of "User" now Press Play to test it Sign in ... Join in channel Now you have User ID and User name of joined Player Let's try to turn off his Microphone ... When you click on this button "User Mic" You can know microphone of which user has been changed Tittle : Mute Mic After you have a User ID, and you want to mute his voice ... You can use event "Mute Mic" or "Speaker On Off"
"Mute Self Mic" to mute your microphone And if it is your friend, you need to turn off his speaker ... user this event instead if you don't want to hear this user voice any more Let's copy 2 these events to use paste them here Let's add "User ID" and "is Muted" value into variables Now we need to know if you want to mute your mic or mute your friend voice To do that : we need to compare this User ID At event "Sign In" You can see your "User ID" when Sign in ... Or use this event to get it anytim
e you want Now let's compare ... If this is your own "User ID", you will mute your self microphone and if it is your friend ID, you will mute your friend's voice If it's True, that means you want to mute your own microphone add value of "is Muted" here to mute or un-mute the mic if it is your friend ID, so you will want to mute his voice you need to use "Speaker On Off" to do that add "User ID" of your friend that you want to mute and value of "is Muted" into Print out a message to see if you ar
e muting your mic or your friend voice Tittle : Test mute mic Copy all script to another PC to test it too on PC 1 : click Sign in then Join in channel on 2nd PC ... 2nd Player has joined in Now if you click on Button Mic of user 1 It means you will mic your own microphone other people in channel can not hear your voice any more If you un-mute your mic, so people can hear your voice again Otherwise, if you click on Button Mic of 2nd user ... You can not hear his voice any more Tittle : On User S
peaking You can detect who is speaking easily with Vivox as well Event "On User Speaking" will trigger whenever a user starts to speak Let's copy and add it into our script You can know User ID, User Name ... and he just started to speak or has just stopped speaking ... if "is speaking" is True ... user just started to speak if "is speaking" is False ... user just stopped speaking Press Play to test it As you see : when my mic has sound ... it will be detected as working and when I don't talk an
y more ... it will be detected as not working Tittle : Send / Receive Message in channel To send message to your channel , and it will show this message to all users We will use this event [Send Message in Channel] When message is received, it will show to all users ... with event [On Channel Message received] and each message you received you can know who sent it, or its Message ID or Message text ... Copy 3 of these events to use You can paste it any where you want Let's create a button to tes
t you can choose any buttons you like, Button "space" or "enter" When Button is pressed down, it will send a message to our channel just type the "Channel Name" you want to send message to and the text of your message When Message is received by channel, it will send to all users and event [On Channel message received] will be triggered You can know all information of the message you received Channel of the message, who sent it, message ID and content of this message Let's print out to Debug Log
who is sent it and the content of the message Press Play to test it You must join in a channel to be able to send message Now press button to "Send Message" Server works well ... and you received the message very fast Tittle : What Vivox can do? You knew all basics to work with Vivox I will tell you some more You can easily delete a Message or edit any messages in Channel When you received a message , you already have its Message ID So you can easily delete it, or edit it with these events If y
ou don't want to use the current mic and you want to change it with another microphone you have or you want to change your Headphone or Speaker ... You can do it easily with these ... [Set Active input device] to change your Microphone and [Set Active Output device] to change your Headphone or Speaker and to see how strong sensivity of your microphone ... use this event Remember that anything Discord can do ... you can do it in Vivox too ^ ^ Thank you for watching !

Comments