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

WebcamTexture always return "16" for width and height.

Discussion in 'General Graphics' started by MURAOKA-san, May 20, 2015.

  1. MURAOKA-san

    MURAOKA-san

    Joined:
    May 20, 2015
    Posts:
    1
    Hello,

    I am really a beginner in Unity world, and struggling with webcam.

    First of all, I am trying to get an image from my webcam with the code below,
    and I get an error on WebCamTexture.GetPixels method and the issue looks here;

    -----
    WebCamTexture wct; // at the top of the class

    wct = new WebCamTexture( ) // in Start( )
    -----

    this wct always returns 16 for width and height even I requested bigger image such as 1024x768.
    Webcam looks working since it lits green light and I can see the cam image on the property pane which is not 16x16 sized image.
    I read some similar posts, but always no answer there. Maybe I am missing something really important?
    Please let me know your idea of what I should do... I am totally stuck with this...

    I am working on Mac OS X (latest) and Unity 4.6, trying to make an iOS/Android app.

    Thank you very much in advance.
     
    ROBYER1 likes this.
  2. bombsquare

    bombsquare

    Joined:
    Oct 29, 2014
    Posts:
    8