Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Unity 5.1.1 Android 6.0 Nexus 5 WebCamTexture not working

Discussion in 'Android' started by theDawckta, Dec 15, 2015.

  1. theDawckta

    theDawckta

    Joined:
    Jun 16, 2014
    Posts:
    49
    I have a very simple project setup running this script.
    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEngine;
    3. using System.Collections;
    4.  
    5. public class testScript : MonoBehaviour {
    6.     void Start() {
    7.         WebCamTexture webcamTexture = new WebCamTexture();
    8.         Renderer renderer = GetComponent<Renderer>();
    9.         renderer.material.mainTexture = webcamTexture;
    10.         webcamTexture.Play();
    11.     }
    12. }
    This doesn't seem to work when deployed to the setup I listed off in the subject, works fine in preview. When deployed to the phone I just get a black image on the plane I have the test script attached to.

    I don't want to upgrade Unity cause I need to keep the code base the same as I use this same code io deployments and don't want to fix the bugs that will occur from upgrading. Can anyone help me? Is this a known bug?
     
  2. Dotby

    Dotby

    Joined:
    Nov 12, 2013
    Posts:
    32
    U can try to use other shaders on renderer.material.
     
  3. 52cwalk

    52cwalk

    Joined:
    Nov 23, 2013
    Posts:
    15
    hello
    do you solve the problem now,I meet the same problem.
     
  4. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,960
    You will have to update Unity. If updating it to 5.3.5 doesn't fix it, then your only other option will be getting NatCam.