Search Unity

My prefabs are suddenly broken

Discussion in 'Editor & General Support' started by Marscaleb, Jun 18, 2014.

  1. Marscaleb

    Marscaleb

    Joined:
    Jan 7, 2014
    Posts:
    1,037
    I came back to work today and found that I could not place some of my prefabs into my scene. I get this convoluted error:
    When I select the prefab, the inspector is blank, Earlier there was a message displayed in the inspector, saying something about not being able to modify certain components, but now that message is gone and the inspector is just blank.

    It wasn't like this when I was working on it last week. The only thing I changed was a slight revision to the script SOME of these prefabs are using, but then I changed it back to the way it was and I still have this BS error.
     
  2. ElvisAlistar

    ElvisAlistar

    Unity Technologies

    Joined:
    Oct 2, 2013
    Posts:
    226
    Sounds like either you need to reattach some script to the prefabs or you somehow managed to corrupt them, in which case that is a serious bug in Unity. I recommend you submit a bug report with your project attached either way and Pm me with the bug case number or simply post it here. I'll take a look!
     
  3. Marscaleb

    Marscaleb

    Joined:
    Jan 7, 2014
    Posts:
    1,037
    Well I've already deleted the corrupted assets and rebuilt them. I had work to do and had to move on.

    But if it happens again I'll submit them with a bug report.
     
  4. SantosR

    SantosR

    Joined:
    Dec 18, 2013
    Posts:
    27
    I just had the same problem, with a simple prefab composed of a few sprites, no scripts attached.


     
  5. MetaMythril

    MetaMythril

    Joined:
    May 5, 2010
    Posts:
    150
    I've had this exact same issue repeatedly. I can only use the prefab for one play through when I push play then I have to replace the corrupted file. Oddly enough it's the same prefab file every single time.
     
    twitchfactor likes this.
  6. SpectralEdge

    SpectralEdge

    Joined:
    Sep 17, 2012
    Posts:
    33
    I just lost 6+ hours of work due to this issue. I am quite vexed as I have a long list of things to finish and redoing hours of work was NOT on it. I saved the prefab and everything was working fine. Closed unity to restart computer while I took a meal break and when I returned, opened unity and pulled the prefab in to work on it...and I get the error. Can't even fix the prefab as it won't even drag in to the scene.
     
  7. alphster

    alphster

    Joined:
    Jul 4, 2015
    Posts:
    1
    I found that it happens when your game crashes after doing a bunch of things (like creating new assets like prefabs) but not being able to save your scene because of the crash. Once you reload, you are opening an outdated scene that is confused about all the new stuff it's seeing inside its folders. I save more often now to avoid this, since unity seems to crash fairly often when it doesn't like something.
     
  8. zbearwrestler

    zbearwrestler

    Joined:
    Feb 17, 2015
    Posts:
    1
    I started following the 2D rougelike tutorial to adjust to the unity 2D system for my next project. I had this issue with the prefabs I made that consisted of single image tiles (food, floor, walls, and exit). The prefabs that came with the project still work fine. Here is the error code for ElvisAlistar 746079
     
  9. JeffersonTD

    JeffersonTD

    Joined:
    Feb 5, 2013
    Posts:
    268
    A guess: could it be that your scripts are manipulating the prefab itself instead of an instance of it?
     
  10. misher

    misher

    Joined:
    Apr 22, 2016
    Posts:
    19
    Deleted missed scripts does not help. I have created new prefab, deleted object in scene then reinserted prefab into the scene and it finally become blue.. Hope this will help somone
     
  11. Polypool

    Polypool

    Joined:
    Aug 2, 2018
    Posts:
    1
    So if anyone in the future has this problem try,

    • Renaming the script in unity
    • Reload solution
    • Then switch the name to the same name but this time in C#
    • Save, then reapply the script to the object
    At least that works for me
     
    Marscaleb likes this.
  12. That1phillps

    That1phillps

    Joined:
    May 16, 2018
    Posts:
    10
    Mine was due to a line in the script for PUN2. //photonView.TransferOwnership(PhotonNetwork.LocalPlayer);