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. Dismiss Notice

Camera rotate 90°

Discussion in 'Scripting' started by Nixel2013, Dec 1, 2020.

  1. Nixel2013

    Nixel2013

    Joined:
    May 9, 2019
    Posts:
    139
    Hi

    I have this...very summarized:
    Code (CSharp):
    1.    
    2. private WebCamTexture webCamTexture;
    3.  
    4. public void ActivarCamara()
    5.     {
    6.         webCamTexture = new WebCamTexture();
    7.         ImagenCam.texture = webCamTexture;
    8.         webCamTexture.Play();
    9.     }
    But when I test it on my cell phone the image rotated 90 °, how can this be fixed? I looked for information and it did not give me any results :(
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,336
    Over the years this bug has come and gone in Unity.

    At one point back in 2014 I remember there was even some other way to query if it was rotated or something, and we had to read that and decide to flip it over ourselves.

    Unfortunately it seems like everything to do with video and cameras is always right on the verge of flaking out or exhibiting weird edge case behavior.

    Check if it also might be an interaction between what the phone orientation was when your app started, and the phone orientation when your game in running. I seem to recall Android and iOS had different behavior in this regard.
     
  3. Nixel2013

    Nixel2013

    Joined:
    May 9, 2019
    Posts:
    139

    the app starts and always remains in portrait