Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by rodrigozol · Mar 03, 2012 at 04:51 PM · texturewebcamscene load

WebcamTexture changing scenes - crash

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.

Tks for all.

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Benoit Dufresne · Apr 23, 2013 at 02:07 PM 0
Share

I'm having the same problem and this is the only thread I've found describing this problem.

Rodrigozol, have you found why this is happening?

avatar image tteneder · Jun 26, 2013 at 02:21 PM 1
Share

I can't help you, but I'm confronted with crashes when I use webcamtextures and call Application.Quit() on windows builds. I already filed a bug report. Let's see how it turns out.

5 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by rodrigozol · Apr 23, 2013 at 04:05 PM

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.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
1

Answer by jemonsuarez · Feb 17, 2014 at 03:47 PM

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.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
1

Answer by Emperor · Nov 23, 2016 at 09:36 PM

Just a precision from jemonsuarez's answer: you need to call stop on the webcamtexture before loading your next scene so:

 webcamTexture.Stop();

Please refer to: https://docs.unity3d.com/ScriptReference/WebCamTexture.Stop.html

Hope this help anyone else stuck with this issue!

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Moath-Qwaqneh · Feb 25, 2018 at 08:01 AM 0
Share

Thank you, this solved the issue

avatar image NNSkelly · Apr 13, 2020 at 09:15 PM 0
Share

Nuance: Apparently OnDestroy is too late to Stop() the WebcamTexture successfully without causing the cited device lockout on subsequent requests. Even if you pedantically unbind all references and Destroy and null out the instance. Calling Stop() during OnDisable, however, works just fine. The $$anonymous$$ore You Know --==☆

avatar image
0

Answer by Benoit Dufresne · Jun 27, 2013 at 11:55 AM

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.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by sagaravalanche · May 05, 2018 at 10:31 AM

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.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

13 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

QR-Code Decoding for iOS and Android 0 Answers

webcam texture format 0 Answers

Eyetoy Webcam not working with unity 0 Answers

Using Webcam input as a texture 2 Answers

using unity string plugin webcam 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges