Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. 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