- Home /
Question by
jasminetay · Jun 17, 2015 at 07:07 PM ·
androidcameracrashwebcamtexture
WebCamTexture crashes on android
I tried using WebCamTexture on a plane and it crashes whenever i try to stop it. I'm using it on S6. Did i miss out anything in my codes?
using UnityEngine;
using System.Collections;
public class CameraBackground : MonoBehaviour {
WebCamTexture back;
public Renderer rend;
public bool activeInHierarchy;
public GameObject emptypiece;
// Use this for initialization
void Start() {
back = new WebCamTexture ();
rend = GetComponent<Renderer>();
rend.material.mainTexture = back;
back.Play ();
emptypiece.SetActive(false);
}
// Update is called once per frame
void Update () {
if (emptypiece.activeInHierarchy == true){
back.Stop ();
}
}
}
Comment
Your answer
Follow this Question
Related Questions
How to get smooth device camera in gearvr like passthrough option? 0 Answers
WebCamTexture resolution and cropping problem on Android 0 Answers
Possible to use an external camera (USB) while running on Android? 1 Answer
webcam texture device not identified 0 Answers
How to simultaneously render multiple (web)cam streams in Android 1 Answer