- Home /
Question by
billyjoetyler · Aug 29, 2016 at 09:19 AM ·
errorerror message
Webcam mapping buffer error
I am trying to use the webcamtexture to display a live feed of my web cam in unity. But when I execute the code the plane which the image should be displayed turns black and I get these errors:
The code is shown below:
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class DisplayWebCam : MonoBehaviour {
void Start() {
WebCamTexture webcamTexture = new WebCamTexture();
Renderer renderer = GetComponent<Renderer>();
renderer.material.mainTexture = webcamTexture;
webcamTexture.Play();
}
}
I am using a xbox kinect 360 and it works in other applications, but not unity. I have made sure that the camera is not being used by other applications and the error is still present. I would use the NatCam, but for me $75 is quite expensive! Does anybody know what is causing the errors and how to fix them, so that the camera is displayed inside unity?
Any help is appreciated, many thanks.
error.png
(18.7 kB)
Comment
Best Answer
Answer by billyjoetyler · Sep 01, 2016 at 03:58 PM
I fixed it by using a different USB camera and now it works like a charm!