- Home /
Game crashes on reuse of webcam texture in iphone and ipad
we are using WebcamTexture in our scene to capture photo. When we unload that scene and come again, game crashes on iphone and ipad, in android it works perfect. We have stop() and destroy webcamtexture before switching scene. But it still got crashed when we try to call play() next time.
We are having the exact same issue. Using Unity 4.2.1, iOS 7 SD$$anonymous$$ (also tried it with 5.0 SD$$anonymous$$), on multiple types of devices.
What happens after unload if you Re-Call the same scene?
GetNativeTexture it seems has a hardware handle which may need to be removed before unload/reload.
I'd recommend using if(device != null) when creating your cam instance. If your app is not properly releasing the camera it may fail when it attempts to retrieve it next time.
See what happens if you open another app which uses the cam, leave it running in the background and then open your game. See if it crashes on the first run.
Any subsequent webcamtexture.play() after webcamtexture.stop() causes the crash, irrespective of scene change or not.
Answer by dhawalbanker · Oct 10, 2013 at 12:25 PM
Issue is iOS7 + older than unity4.2.2 version
http://forum.unity3d.com/threads/202199-WebCamTexture-crash-xcode5
https://fogbugz.unity3d.com/default.asp?565268_5utj1nfr7fd4q308
Your answer
Follow this Question
Related Questions
Can I use unity 3d as a component of UI in ipad app? 0 Answers
How do I enable iAds on my unity game for iPhone? 0 Answers
Controlling Unity3D PC Application from IPAD/IPHONE 1 Answer
MIDI on iOS devices 3 Answers
Ampersand in application name 4 Answers