Hi guys,
I’m currently trying to get the camera feed and display onto the scene using sprite.texture. However, I’m stuck with an error at webCamTexture.GetPixels();. The error during runtime, when the function is called.
below is the error and a snippet of my code, please help thanks!!!
Error:
Texture rectangle is out of bounds (0 + 16 > 0)
UnityEngine.WebCamTexture:GetPixels(Int32, Int32, Int32, Int32)
Texture2D disp = new Texture2D(webCamTexture.width, webCamTexture.height, TextureFormat.ARGB32, false);
Color [] output = webCamTexture.GetPixels();//0, 0, disp.width, disp.height);
disp.SetPixels(output);
disp.Apply();