- Home /
WebCamTexture does not stop
I have a WebCamTexture to capture the camera. And When you go to the next scene I call Stop() of the WebCamTexture. But the camera does not stop. And the next time I get in the scene that uses the webcam, the camera is not able to start again and gives a black screen.
There are no error messages the second time I try to access the camera.
Here is the code I use to initialize the camera:
string camName = WebCamTexture.devices[0].name;
_webCamTexture = new WebCamTexture(camName);
_cameraTexture.material.mainTexture = _webCamTexture;
And to start and stop the webcam I use:
_webCamTexture.Play();
_webCamTexture.Stop();
Answer by $$anonymous$$ · Nov 08, 2013 at 10:18 AM
It was a bug in Unity 4.2.1 updating to 4.2.2 resolved this issue.
Answer by adikecapan · Aug 08, 2019 at 02:23 AM
same problem here. and iam using unity 2019.1 it wont pause the webCam when i use webCamTexture.Pause();
Your answer
Follow this Question
Related Questions
Switching between front/back device cameras and saving screenshot to photo album 0 Answers
WebCamTexture resolution and cropping problem on Android 0 Answers
How to use device camera to click picture then store it in resources folder in runtime? 0 Answers
Projection mobile camera on a texture, at the same time using it as AR camera. Is it possible? 0 Answers