- Home /
Question by
noobcoder23 · Nov 19, 2014 at 06:18 PM ·
chatvoicepls
My Voice Chat Script Don't work
Hi, i'd like make a voice chat script for my online fps game but i don't have any ideas how can i make it i searched in this site and found some solutions but it didn't work. (http://answers.unity3d.com/questions/655062/multiplayer-voice-chat.html) my code :
#pragma strict
function Start () {
InvokeRepeating ("OnConnectedToServer", 1, 1);
InvokeRepeating ("PlayMicrophone", 1, 1);
}
function Update () {
}
@RPC
function PlayMicrophone()
{
audio.clip = Microphone.Start("", true, 100, 44100);
audio.loop = true;
while (!(Microphone.GetPosition("") > 0)){}
audio.Play();
}
function OnConnectedToServer()
{
networkView.RPC("PlayMicrophone", RPCMode.Others);
}
Comment
Answer by SahilBhilave · Apr 07, 2015 at 12:58 PM
1.Add a Audio Source to your camera select the camera AddComponent>Audio>Audio Source
2.Add a Network View AddComponent>Miscellaneous>Network View
Your answer

Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Voice chat in browser based unity projects 3 Answers
Voice Communication System in Split Screen Game 0 Answers
Looking for a chat text box that allows voice chat... 0 Answers
Only activate chat if T is pressed 0 Answers