Search Unity

Drag select in prefab mode

Discussion in 'Prefabs' started by rmclachlanTCR, Mar 22, 2019.

  1. rmclachlanTCR

    rmclachlanTCR

    Joined:
    Nov 16, 2018
    Posts:
    4
    We're using 2018.3.8f1.

    I wanted to rearrange the hierarchy of some objects in a prefab (I've moved a whole section of level geometry objects into a prefab so I can share the prefab between multiple scenes).

    I drag selected in the 3D prefab view the geometry objects I wanted to reparent, then in the Hierarchy dragged them to be under a new empty GameObject created under the prefab.

    However the drag select in the prefab 3D view seems to select invisible objects from all other loaded scenes as well, so a whole selection of game entities and other prefabs from multiple entirely different loaded (but not visible, I'm in prefab mode) scenes have now ended up inside my prefab - with no easy way to restore them to their former scenes and hierarchy positions or restore their references to other GameObjects

    I can't quite understand how this is possible - isn't Prefab Mode protected and completely detached from Scene mode? Isn't that the whole point??

    Apologies for not creating a bug report but I can't see a link anywhere to do so - and I've not got the time as I have to revert all my scenes and start again from scratch.
     
  2. runevision

    runevision

    Joined:
    Nov 28, 2007
    Posts:
    1,892
    Yes, it's meant to be. What you're describing sounds like a bug. (I can't reproduce it here.)

    https://unity3d.com/unity/qa/bug-reporting

    It's up to you if you report it or not. We just can't look into it if we don't get a repro case.
     
  3. rmclachlanTCR

    rmclachlanTCR

    Joined:
    Nov 16, 2018
    Posts:
    4
    Apologies for being short, I lost a fair amount of work as I was doing a lot of hierarchy changes in multiple scenes and undo did not work to fix all the broken references - the objects which were dragged into the prefab were lost from my scenes permanently.

    I've submitted a bug report via the editor.

    Here is a repro case in an empty 2018.3.8f1 project - the behaviour is related to 3D gizmos it seems:

    1. Create a line of ~5 cubes
    2. In the Hierarchy window drag 4 of the cubes onto the 1st one
    3. Drag the 1st cube into the Project folder to create a new prefab
    4. Create some empty gameobjects and give some of them a 3d gizmo label/icon/lozenge
    5. Move the empty gameobjects so they are in roughly the same place as some of the cubes

    UnityPrefabBug.PNG

    6. Open the prefab (i.e. go into prefab editing mode on the cube prefab)
    7. Drag select the cubes which had the test gameobjects next to them
    8. In the prefab hierarchy reparent the selected cubes by dragging them onto one of the unselected cubes
    9. Note that any gameobjects from the scene with gizmos are pulled into the prefab:

    UnityPrefabBug2.PNG
     
  4. rmclachlanTCR

    rmclachlanTCR

    Joined:
    Nov 16, 2018
    Posts:
    4
    Bug: (Case 1140279) Drag select in Prefab mode will also select gameobjects with gizmos in any loaded scene
     
    runevision likes this.
  5. runevision

    runevision

    Joined:
    Nov 28, 2007
    Posts:
    1,892
    Thanks! We'll look into it.