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

Build succeeds but camera renders black screen on iOS

Discussion in 'iOS and tvOS' started by MrConkin, Feb 21, 2016.

  1. MrConkin

    MrConkin

    Joined:
    Feb 11, 2013
    Posts:
    20
    I have two scenes in my build, a title screen and the game proper. I can build it to my iPhone fine, but when I open the app a couple of strange things happen:

    1. The Unity logo is skipped, even after a full restart of the app
    2. My Title scene works fine, but once I initiate the scene change to start the game..
    3. The screen goes black, with the exception of a simple GUI string displaying the fps.

    This leads me to believe that the scene is running, but the iDevice doesn't agree some rendering process I am doing (which afaik is nothing fancy). My quality settings are currently set to Simple, which I have not had a problem with before. Any ideas how to trouble shoot this?
     
  2. tomworcom

    tomworcom

    Joined:
    Dec 27, 2011
    Posts:
    44
    I got a similar problem.
    Two scenes, one menu, one game. Game starts and I hear the background music, but just see a black screen. When I tap the screen, I do get the UI layer to display properly (like it should in my case, after tapping the screen).
    Game scene itself works fine.

    Should mention I have two cameras in the scene, one that's rendering the main action and another rendering an element in front of everything.

    Main camera:
    - Clear flags: Don't clear
    - Culling mask: Everything except 'CameraFront'

    Front camera:
    - Layer: CameraFront
    - Clear flags: Solid color
    - Culling: Just 'CameraFront'

    Works fine on e.g. Standalone Mac build.
    Problem seemed to appear with 5.3.2f1 but can't confirm 100%.
     
  3. tomworcom

    tomworcom

    Joined:
    Dec 27, 2011
    Posts:
    44
  4. lishuai

    lishuai

    Joined:
    Feb 18, 2012
    Posts:
    7
    Me too, this error occurs 5.3.2p2,5.3.2p3,5.3.2p4!
     
  5. tomworcom

    tomworcom

    Joined:
    Dec 27, 2011
    Posts:
    44
    Sadly, I get the error after downgrading to 5.2 too... maybe it's related to the new XCode version.
    Looks like I got to sit this one out.
     
  6. MrConkin

    MrConkin

    Joined:
    Feb 11, 2013
    Posts:
    20
    Glad you found what was causing your issue. In my case, it turns out to be altogether different. In the interest of helping anyone who encountered the same issue that I did, turns out it that for me it wasn't a rendering issue, but rather an iPhone issue with the interpolation of the rotation in the animation (mouthful) of my camera. By default, interopolation is set to Euler Angles, which was causing my iPhone 6 to return the camera's rotation as NaN. Changing the interpolation to Quaternion solves the issue. You can change the interpolation of an animation by navigating to the Animation window, right clicking on Rotation, and selecting Interpolation > Quaternion.

    More details here: http://answers.unity3d.com/questions/1113969/getting-nan-on-ios-when-using-animation.html