Search Unity

Connecting A randomobject to a Prefab

Discussion in 'Immediate Mode GUI (IMGUI)' started by BinaryCats, Aug 20, 2017.

  1. BinaryCats

    BinaryCats

    Joined:
    Feb 8, 2016
    Posts:
    317
    hi
    I have an object which was once connected to a prefab. But due to several, several manipulations of it has lost all references to the prefab. I can not use Prefab Utilities's ReconnectToLastPrefab as it has lost this reference.

    ConnectGameObjectToPrefab seems to be the most likely path to the solution, however this reverts the object to the prefab instance. So if I will lose any modifications on the gameobject I have made. Does anybody know how I can connect the gameobject to the prefab without essentially reverting it to the parent prefab?
     
  2. LaireonGames

    LaireonGames

    Joined:
    Nov 16, 2013
    Posts:
    705
    You can always just drag the object into the Project folder and make a new prefab from it, then update where it is used with the new prefab. Don't know your project structure but sounds like the easier way to deal with it!
     
  3. BinaryCats

    BinaryCats

    Joined:
    Feb 8, 2016
    Posts:
    317
    unfortunately this is not an option. This is for a tool which manipulates prefabs. This can not be done manually by dragging.

    I want to be able to be able to connect the gameobject to the prefab, as a disconnected prefab. or a connected prefab with different properties.
     
  4. marijnz

    marijnz

    Joined:
    Sep 20, 2012
    Posts:
    67
  5. BinaryCats

    BinaryCats

    Joined:
    Feb 8, 2016
    Posts:
    317
  6. carlossalasamper

    carlossalasamper

    Joined:
    Sep 15, 2015
    Posts:
    4
    When you have a lot of sprites and you change the spritesheet, for example, you have a similar problem (dragging sprites on the animator). Editor issues!! next time try to find references by script, It's my opinion!