Quantcast
Channel: Questions in topic: "webcam"
Viewing all articles
Browse latest Browse all 256

Check if no webcam

$
0
0
I'm getting an "Array index is out of range" error on the if statement of the following code. private var webCamTexture : WebCamTexture; function Start () { if (WebCamTexture.devices.Length > 0) { //Get device var deviceName = WebCamTexture.devices[0].name; //Create web cam texture from device webCamTexture = new WebCamTexture(deviceName, 640, 360, 30); //Play the web cam texture webCamTexture.Play(); //Change this objects texture to the web cam texture renderer.material.mainTexture = webCamTexture; } } I thought this would be how to check if there are no webcams on the system.

Viewing all articles
Browse latest Browse all 256

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>