Search Unity

Prefabs references lost after instanciation

Discussion in 'Prefabs' started by stalker_shin, Aug 30, 2018.

  1. stalker_shin

    stalker_shin

    Joined:
    Jun 25, 2016
    Posts:
    17
    Hi there,

    I've got this weird issue happening on my project that I just upgraded to use that new improved workflow :
    -> I set a reference of another prefab in prefab mode that disappear when I programmatically instanciate this prefab on runtime.
    Is this behavior normal or is this a known issue?

    In Editor Mode :


    In Runtime :


    I must add that some references in the project still work while some broke.
    And needless to say that I tried this upgrade on a stable project and these references worked before :)

    Thank you for your help!
     
  2. stalker_shin

    stalker_shin

    Joined:
    Jun 25, 2016
    Posts:
    17
    Ok nevermind.

    I just set these references to none then drag and droped the prefabs again and it worked!
    Note that when I tried overriding the existing references it didn't work.

    I let my topic in case someone has the same issue.
     
  3. Deepoo

    Deepoo

    Joined:
    Apr 15, 2021
    Posts:
    4
    @stalker_shin did you find a fix for this issue. i have the same issue. once i try drag my gameobject to convert it into a prefab, the prefab loses all the references in the inspector.
     
  4. stalker_shin

    stalker_shin

    Joined:
    Jun 25, 2016
    Posts:
    17
    Sorry @Deepoo I don't have a better answer than re-creating the links by removing it then relinking it.

    Note that my issue is not really the same, my prefab was ok while I was not playing. I still had these references actually shown in the editor until I played and looked at it in the scene hierarchy.