Unity Webcamtexture Android

Unity

Hey there,

I read that a lot of people are having problems with the Unity WebCamTexture and Android. Indeed the problem comes from the fact that the texture streamed from the webcam is always flipped by 180 degrees and you will always get a wrong rotated picture of the camera (even if.

  • カメラアプリのようなものを作ってみようとUnityのWebCamTextureを用いてモバイルデバイスのカメラからフルスクリーン映像を表示していた際、映しだされる映像が伸びているor縮んでいるということがあったので調べてみることに。 具体的にはアプリ起動時に、 スクリーンサイズを取得 Vector2.
  • カメラで撮影している画像情報を取得したいなぁ。 いえ、Unity上のカメラじゃないですよ。 iOSやAndroidの端末にあるカメラで映している画像情報が欲しいのです。 望むことなら、エディター上でもWebカメラで映している画像情報を取りたいな。 でもネイティブコードを書くのは大変そうだし.

I've already asked a question about how to get the android lock screen enabled in dev builds because I need to debug an issue which only occurs when the lock screen is shown. However I thought I ask if anyone knows how to just solve the problems I'm having.

Unity Webcam Texture Android Download

Webcamtexture to texture2d

I'm almost certain it has something to do with the WebCamTexture as, in most parts of my app, I can lock then unlock the device just fine. In the one part which uses a WebCamTexture to show the feed from the device's camera on screen, things go wrong.

UnityUnity Webcamtexture Android

What tends to happen is that once I unlock, the app resumes but some of my UI elements are missing. Specifically the RawImage displaying the WebCamTexture is missing as are any UI elements in the same level of the Unity Editor's hierarchy or lower. UI elements higher up the hierarchy are present and correct. In my case this means before I lock the device I can see this;

An exit button in the top left, my WebCamTexture center, and two buttons along the bottom. However after I unlock the screen I see this;

All the UI bar the exit button is missing. Sometimes the app continues to work though all I can do his hit the exit button. Sometimes it crashes shortly after. I've tried my best to work around the problem by disabling the WebCamTexture when the lock occurs and so on but so far I've had no luck.

Any advice would be gratefully received.

Unity3d Webcamtexture

1.png(403.4 kB)