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

[BUG][Case 1089423] 'Open Prefab' with RectTransform on prefab root failed with some prefabs

Discussion in 'Prefabs' started by aurelien-morel-ubiant, Oct 10, 2018.

  1. aurelien-morel-ubiant

    aurelien-morel-ubiant

    Joined:
    Sep 27, 2017
    Posts:
    275
    Hello,
    we try to switch our huge application to your new system and we face some issue with the "Open Prefab" feature.
    For example we have a prefab with a RectTransform on its root which is this one :
    upload_2018-10-10_11-2-45.png

    As you can see everything seems to be ok, the prefab is load with a parent that will setup a canvas to render it in a good way.

    But on many other prefab with the same RectRansform on root logic we have some issue cause Unity doesn't detect it's a UI prefab and doesn't generate a parent with a Canvas like this one :
    upload_2018-10-10_11-4-34.png

    Are we missing something ? Ot is it an issue within your engine ? Cause actually it's quite annoying.... It's impossible to work with this random behaviour.

    We tried to setup a scene in the Settings window where you can specify a scene for UI and one for environment but it changes nothing.

    We gonna try to setup a project that allow us to repro this to submit a bug if it can help. Except if you have already had a report on this or a bug fix in the pipe.

    Thanks again.
    Aurélien.
     
  2. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,132
    That would be much appreciated! Even if the issue was already known (which it isn't), additional repros help to ensure that a fix covers as much ground as possible.
     
  3. Mads-Nyholm

    Mads-Nyholm

    Unity Technologies

    Joined:
    Aug 19, 2013
    Posts:
    217
    Does your
    MenuHome
    GameObject have a Canvas component on itself? If so we don't generate a Canvas since we assume you want to use this Canvas.
     
  4. aurelien-morel-ubiant

    aurelien-morel-ubiant

    Joined:
    Sep 27, 2017
    Posts:
    275
    We don't have a canvas on the MenuHome root element.

    But we have some canvas in children of MenuHome and this is the issue we just tested.
    MenuHardwareSetting.prefab has no canvas in any game object and your "Open Prefab" generate a canvas to display this menu.
    MenuHome contains some canvas deeper in its hierarchy and it will create this behaviour.

    If we remove all the "Canvas" in the prefab, your "Open prefab" will generate a fake canvas to display the prefab in a good way.

    So @Mads-Nyholm the "open prefab" doesn't generate a Canvas Object to parent the prefab if there is a canvas anywhere in the prefab hierarchy which is quite annoying :/

    The fogbuz related case is : Case 1089423
     
    Last edited: Oct 10, 2018
    LeonhardP likes this.
  5. Mads-Nyholm

    Mads-Nyholm

    Unity Technologies

    Joined:
    Aug 19, 2013
    Posts:
    217
    Thank you for the additional information. We will take a look at the bug you reported.
     
  6. Mads-Nyholm

    Mads-Nyholm

    Unity Technologies

    Joined:
    Aug 19, 2013
    Posts:
    217
    We have found the issue you reported. Thanks again for bringing this to our attention.

    The fix is coming in a future beta version
     
  7. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,132
  8. aurelien-morel-ubiant

    aurelien-morel-ubiant

    Joined:
    Sep 27, 2017
    Posts:
    275
    thanks for the link !
     
    LeonhardP likes this.
  9. aurelien-morel-ubiant

    aurelien-morel-ubiant

    Joined:
    Sep 27, 2017
    Posts:
    275
    Any ETA for this fix ?
    Some of my developers enraging against it ^^.
    And it seems to create a custom Environment scene in Settings doesn't solve the problem. (I haven't test it, This is what they say)
     
  10. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,132
    This issue no longer reproduces with b8.
     
    aurelien-morel-ubiant likes this.