Search Unity

Bug reported with Unity 5.6.0b1: Executing Instantiate(.. with a UI Input Field in scene

Discussion in '5.6 Beta' started by vspin, Dec 21, 2016.

  1. vspin

    vspin

    Joined:
    Mar 29, 2014
    Posts:
    10
    (Unity 5.6.0b1)

    I was banging my head over an problem until I finally discovered the issue. Executed Instantiate(Object original, Transform parent, bool worldPositionStays) with a UI Input Field in scene draws the following error:

    Transform has SetIsDispatchInterested present when destroying the hierarchy. Systems must deregister themselves in Deactivate.
    UnityEngine.UI.ScrollRect:LateUpdate()

    Transform has SetIsHierarchyDispatchInterested present when destroying the hierarchy. Systems must deregister themselves in Deactivate.
    UnityEngine.UI.ScrollRect:LateUpdate()


    The following error was outputted when I stopped:

    System is not interested in this transform, SetSystemInterested may only be called on transforms that are set interested.

    Assertion failed on expression: 'GetSystemInterested(transform, system) != enable'



    This is not a problem with Unity 5.5.0f3. Unfortunately for me, 5.5.0f3 has an issue with kinetic scrolling on ScrollViews that has been fixed in this beta version. Arghh!!


    UPDATE: Actually, it's not the Instantiate method. Anytime there is a UI Canvas that contains an active UI TextField and an active GameObject with the SpriteRenderer component, this error will occur.
     
    Last edited: Dec 21, 2016
  2. Boven_1

    Boven_1

    Joined:
    Sep 24, 2015
    Posts:
    2
    did you solve this problem?
     
  3. GeekyMonkey

    GeekyMonkey

    Joined:
    Feb 9, 2013
    Posts:
    13
    I'm having the same problem with 5.6.0b3. I have a text input on a canvas that starts out disabled. Once I enable the canvas, these errors happen. The errors aren't there if I disable the input.
     
  4. vspin

    vspin

    Joined:
    Mar 29, 2014
    Posts:
    10
    When an active SpriteRenderer and a TextField share the same canvas, the errors are thrown, however, if you set the font to none on the TextField's text component, the error goes away but makes the TextField not useable (obviously).

    It's been 10 days since I submitted the bug, and it is still not looked at.


    EDIT: Actually, there is one workaround. Put all your SpriteRenders outside your Canvas.
     
    Last edited: Jan 1, 2017
  5. vspin

    vspin

    Joined:
    Mar 29, 2014
    Posts:
    10
    For reference, the case number is: 863470
     
  6. topaz7

    topaz7

    Joined:
    Dec 15, 2012
    Posts:
    76
    This is really frustrating issue for a dynamic UI based game. Please look into this one.
     
  7. phil-Unity

    phil-Unity

    Unity UI Lead Developer Unity Technologies

    Joined:
    Nov 23, 2012
    Posts:
    1,140
    Hey, So we found out what the issue is. Its a conflict between a new system being used and how the Transform to RectTransform is done on the back end. Really it had nothing to do with it being a InputField or anything but more that it was instantiating things in a "wrong" order. We have a fix that i'll see when i can get it backported to.
     
    vspin likes this.
  8. lt0

    lt0

    Joined:
    Feb 5, 2016
    Posts:
    2
    Hi guys,

    I just encountered this issue not being fixed in 5.6.0b4 while calling
    Code (csharp):
    1. var go = new GameObject(...)
    2. go.AddComponent<RectTransform>();
    changing this to Instantiation of a Prefab which already has a RectTransform-Component solved it for me.
     
    Last edited: Jan 25, 2017
  9. Venryx

    Venryx

    Joined:
    Sep 25, 2012
    Posts:
    442
    I have the same issue in 5.6.0b4. I will try the solution mentioned.
     
  10. ccsander

    ccsander

    Joined:
    May 17, 2013
    Posts:
    38
    The bug tracker for 863470 shows it is fixed in 5.6.0, but I'm still having issue with latest beta (5.6.0b7). Any idea which release the fix is slated for? Thanks

    ccs
     
  11. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    1,581
    The fix should be implemented. Could you please file a bug report if you still experience issues?
     
  12. ccsander

    ccsander

    Joined:
    May 17, 2013
    Posts:
    38
    OK let me see if I can create a small testcase that demonstrates the issue. It seems to have to do with InputText only.
     
  13. ccsander

    ccsander

    Joined:
    May 17, 2013
    Posts:
    38
    It took a while to make a simple testcase, but I managed to figure it out. It seems to happen when you have a gameobject with a mesh renderer and another gameobject that has InputText UI component where both gameobjects share a similar parent up in the hierarchy somewhere. I submitted a ticket for it with project included:

    https://fogbugz.unity3d.com/default.asp?880201_irmbs66u8si31o1v

    ccs
     
    Venryx likes this.
  14. ccsander

    ccsander

    Joined:
    May 17, 2013
    Posts:
    38
    Unity QA just responded this will be fixed in 5.6.0b8, probably due out soon!
     
    LeonhardP likes this.
  15. ccsander

    ccsander

    Joined:
    May 17, 2013
    Posts:
    38
    Confirming this was fixed. I just tried it in 5.6.0.b9.
     
    Venryx likes this.