I have object/plane that uses the WebcamTexture function. When I run by the first time the “scene A”, that contains the object/plane with webcam’s script, the webcam captures works fine, but if I change to a “scene B” and after get back to the “scene A”, the captures doesn’t work anymore. I even have to restart Unity for to make the capture works again at “scene A”. Im my project I need to switch from “Scene A” to “Scene B” back to “Scene A”.
Is there any function to “refresh” the webcam? I tried “DestroyImmediate” at object/plane when loading “scene B”, but the problem persist.
I had the same issue on webcam and the solution is calling gameObject.renderer.material.mainTexture.Stop().
I have tested with a few computers and different webcams, and it works.
In a beginning I was searching for a driver problem, but not.
Call Stop() and will not need to hace all in the same scene.
Benoit, I haven’t found the solution. I had the same problem with Kinect’s camera. So, to solve the problem, I developed the game just with one scene, with multiples scenes. It works cause it was a simple/small game.
Make sure you use Stop() before loading a new scene. In my case I was doing it, but had a stray component using a webcam on an object I had completely forgotten about. This one I didn’t Stop() and seemed to be causing the camera to stay in use until I restarted Unity.
Did anyone find the solution for the problem. I;m currently having the same issue.
Please help
Thanks,Did anyone find the solution for the problem. Currently I’m facing the same issue.
Please help.