how could i change this code to access front cam, currently it shows me back cam.? I have tried some different things, but doesn't seem to be working.
if (isLocalPlayer)
{
if (this.gameObject.name == "Player 1") {
WebCamTexture webcamTexture = new WebCamTexture ();
Player1Image.GetComponent<RawImage> ().texture = webcamTexture;
Player1Image.GetComponent<RawImage> ().texture = webcamTexture;
Player1Image.GetComponent<RawImage> ().material.mainTexture = webcamTexture;
webcamTexture.Play ();
} else if (this.gameObject.name == "Player 2") {
WebCamTexture webcamTexture = new WebCamTexture ();
Player2Image.GetComponent<RawImage> ().texture = webcamTexture;
Player2Image.GetComponent<RawImage> ().texture = webcamTexture;
Player2Image.GetComponent<RawImage> ().material.mainTexture = webcamTexture;
webcamTexture.Play ();
} else if (this.gameObject.name == "Player 3") {
WebCamTexture webcamTexture = new WebCamTexture ();
Player3Image.GetComponent<RawImage> ().texture = webcamTexture;
Player3Image.GetComponent<RawImage> ().texture = webcamTexture;
Player3Image.GetComponent<RawImage> ().material.mainTexture = webcamTexture;
webcamTexture.Play ();
} else if (this.gameObject.name == "Player 4") {
WebCamTexture webcamTexture = new WebCamTexture ();
Player4Image.GetComponent<RawImage> ().texture = webcamTexture;
Player4Image.GetComponent<RawImage> ().texture = webcamTexture;
Player4Image.GetComponent<RawImage> ().material.mainTexture = webcamTexture;
webcamTexture.Play ();
} else {
Debug.Log ("All slots full!");
GameObject.Destroy (this);
Network.Disconnect ();
}
}