Search Unity

5.6.b9 and b10 - Enabling or adding a Renderer during rendering; this is not allowed.

Discussion in '5.6 Beta' started by panbook, Mar 6, 2017.

  1. panbook

    panbook

    Joined:
    May 25, 2012
    Posts:
    16
    Hi,

    We tried switch to 5.6b9 and 5.6b10 and we see this error:

    Enabling or adding a Renderer during rendering; this is not allowed. Renderer 'New Game Object' will not be added.

    if fact, we use SetActive(true) inside of OnWillRenderObject()

    but under 5.5.1f there is no errors.

    What changed?

     
  2. Spanky11

    Spanky11

    Joined:
    Mar 9, 2015
    Posts:
    283
    I'm seeing the same error with 5.6.0f1. I didn't see this in 5.6b11 or 5.6b9.
     
  3. JakeTurner

    JakeTurner

    Unity Technologies

    Joined:
    Aug 12, 2015
    Posts:
    118
    Hi,

    I think this is a side-effect of some graphics bug fixes. The behaviour now is:

    Prevent adding/removing renderer from inside OnPreRender() and OnWillRenderObject() callbacks.

    This is because the output from the scene culling has been determined (at this point in the rendering pipeline) and changes to the scene could lead to the culling output being out of sync with the scene which can lead to rendering bugs and potentially crashes.

    Thanks

    Jake
     
    richardkettlewell and Peter77 like this.