Simple code snippet to get WebCam input into unity3d.
string deviceName = devices[index].name;
objWebCam = new WebCamTexture(deviceName);//, 400, 300, 12 //overloads
gameObject.GetComponent<MeshRenderer>().material.mainTexture = objWebCam;
objWebCam.Play();
And I am frequently getting this error
Could not connect pins - RenderStream()
UnityEngine.WebCamTexture:Play
But (for solution) when I
- Restart my unity application (OR)
- Re-plug my WebCam (OR)
- Restart my PC
Then, it didn't show any error and works correctly. Why I am getting this error frequently?