Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

WebCamTexture flashing bug

Discussion in '2019.2 Beta' started by JCereda, Aug 29, 2019.

  1. JCereda

    JCereda

    Joined:
    Aug 29, 2019
    Posts:
    3
    WebCamTexture is broken using Unity 2019.2.2f1 for Android. We used a Moto G5 plus and a Xiami MI 9t.

    This is the simple code of my script, nothing else in the scene.

    Code (CSharp):
    1.  
    2. public class WebCamera : MonoBehaviour
    3. {
    4.     public RawImage rawImage;
    5.     private WebCamTexture webCamTexture;
    6.  
    7.     void Start()
    8.     {
    9.         Screen.sleepTimeout = SleepTimeout.NeverSleep;
    10.         webCamTexture = new WebCamTexture(WebCamTexture.devices[0].name, 1280, 720);
    11.         rawImage.texture = webCamTexture;
    12.         rawImage.material.mainTexture = webCamTexture;
    13.         webCamTexture.Play();
    14.     }
    15. }
    16.  
    Camera artifacts after a few seconds, flashing black to normal. This problem stops if you stop the camera and play again, but it keeps happining each time after playing a few seconds/minutes.

    Reproducing the same scene using the 2018.4.7 LTS editor the camera works just fine.
     
    Last edited: Aug 29, 2019