- Home /
Question by
soof · Aug 08, 2015 at 10:13 AM ·
webcamtexturewebcam
WebCamTexture camera not activating
I am trying to show what my webcam is displaying on a texture I used the below code and it says "There is no renderer attached not sure what kind of renderer i would need to attach.
public WebCamTexture mCamera = null; public GameObject plane;
// Use this for initialization
void Start ()
{
Debug.Log ("Script has been started");
plane = GameObject.FindWithTag ("MainCamera");
mCamera = new WebCamTexture ();
plane.GetComponent<Renderer>().material.mainTexture = mCamera;
mCamera.Play ();
}
// Update is called once per frame
void Update ()
{
}
}
Comment
Your answer
Follow this Question
Related Questions
WebCameTexture.Play() Could not connect pins - RenderStream() 5 Answers
webcam Capture from webcam encountered: IndexOutOfRangeException: Array index is out of range 0 Answers
WebCam Texture scaling on iPhoneX 1 Answer
How do I adjust the brightness, color and contrast using a slider? 0 Answers
WebCamTexture ERROR - Could not find specified video device 2 Answers