Simply trying to use WebCamTexture to see video in game. But unity will not detect device camera on laptop or my phone. I know the code works because I used it before. I keep getting this error.
Cannot find webcam device no camera available..
UnityEngine.WebCamTexture:Play()
kslklvk:Start() (at Assets/kslklvk.js:10)
Unity simply will not detect the camera on a windows or andriod device to use the WebCamTexture.
Please help
Here is the code I am using.
var cam2:UI.Image;
function Start () {
var devices:WebCamDevice;
var webcamTexture:WebCamTexture = new WebCamTexture();
var renderer:Renderer = cam2.GetComponent(Renderer);
renderer.material.mainTexture = webcamTexture;
webcamTexture.Play();
}
function Update () {
}
↧