Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

After executing OnPreRender callback, Camera 'Main Camera' is no longer valid to use for rendering

Discussion in 'Android' started by palex-nx, Dec 12, 2018.

  1. palex-nx

    palex-nx

    Joined:
    Jul 23, 2018
    Posts:
    1,748
    Hello Unity community!

    Hope I can get some help here. My android build is not rendering (blank screen). There's message in the player log:

    > After executing OnPreRender callback, Camera 'Main Camera' is no longer valid to use for rendering.

    I've googled, searched the manual and looked through unity cs reference reposutory on github, but was unable to find what may cause this message. Maybe here is someone who knows how to fix that or at least what to look for in my project?

    Forgot to say, in the editor everything is working as intended. It is a 2d game made with canvas.
     
    janneville likes this.
  2. exsurgo_ankit

    exsurgo_ankit

    Joined:
    Feb 5, 2020
    Posts:
    29
    Hello Palex,

    Did you manage to find a solution to this problem?

    regards
    Ankit
     
  3. palex-nx

    palex-nx

    Joined:
    Jul 23, 2018
    Posts:
    1,748
    Yes. I made a render feature.
     
  4. fdsagizi2

    fdsagizi2

    Joined:
    Nov 4, 2013
    Posts:
    70
    why it can be happen ?
    no we receive this but too, but it hard to repeat
     
  5. hermer29

    hermer29

    Joined:
    Feb 24, 2021
    Posts:
    1
    Anybody solved this problem? Same issue as author described
     
  6. Radivarig

    Radivarig

    Joined:
    May 15, 2013
    Posts:
    120
    Reproducible by settings the camera.targetTexture to have a larger size than Screen.

    The targetTexture output starts being squashed gradually with speed depending on how much its size is bigger than the Screen so if you reduce it back in time it will start unsquashing and recover.

    But if the squashing reaches less than a pixel it will break with that error and I didn't find a way to recover it.

    Don't try this in edit mode...