private WebCamTexture webcamTexture;
void Start()
{
WebCamDevice[] devices = WebCamTexture.devices;
if(devices.Length > 0){
webcamTexture = new WebCamTexture(devices[1].name,1920,1080,30);
webcamTexture.Play();
}
renderer.material.mainTexture = webcamTexture;
webcamTexture.Play();
}
I have 2 cameras - a crappy built-in and logitech c920 (full hd) I want to use that one for the video stream. The funny thing is that when I try to run that as it is here the camera starts to blink and the game freezes until i unplug the camera. When I use
webcamTexture = new WebCamTexture();
webcamTexture.deviceName = devices[1].name;
instead of
webcamTexture = new WebCamTexture(devices[1].name,1920,1080,30);
it works albeit in low resolution.
What should I do?