Search Unity

Prefab messed up

Discussion in 'Getting Started' started by josoka, Sep 11, 2019.

  1. josoka

    josoka

    Joined:
    Mar 22, 2019
    Posts:
    5
    Guys, I need help

    A scene that I work don't seem to be able to find the correct prefab

    I collect all the prefabs I use within a scene into a folder "effect"

    I sure do have the prefab there, but in the scene it was marked "prefab missing".

    I suspect (after a search) because the one that's applied in the scene have different GUID than what's available within my local folder

    So my question is, is there any way to correct the scene prefab so that it get the already available local prefab file?

    I can't seem to find any way to edit the applied prefab so that they match on the file's GUID. Did tons of search, none useful for this case.

    Thanks in advance
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    6,322
    If you moved the prefab to the new folder within Unity this should not have happened. I'm guessing you moved the prefab outside of Unity and didn't bother to also move its meta file. Don't do it this way in the future. Or you somehow lost the prefab meta files.

    What I would do is just use your version control system to roll back to just prior to you moving the prefabs. If you're not using version control (there lies insanity, I'm guessing you refuse seat belts on roller coasters as well), then I'd manually fix all the problems this caused in your scenes by deleting the prefabs in the scenes and replacing them with the prefab from your Assets. Though you could attempt some manual editing of the meta files if you had set them to text only (I wouldn't, there lies more insanity).
     
    Last edited: Sep 11, 2019
  3. josoka

    josoka

    Joined:
    Mar 22, 2019
    Posts:
    5
    Yeah sometimes I used Windows Explorer sometimes I used Unity's explorer.

    I guess that's a no-no. But this case is solved anyway, I redid them all ROFLMAO.

    This GUID system of unity is a bit quirky.

    Sometimes it forces the same asset (textures and such) to a prefab when I don't want to (even though I deleted all the meta files within using windows explorer). In short I intentionally wanted to separate the assets for further editing later on.

    While sometimes it's not when I want it to refer the prefabs to the same asset.

    Sometimes my prefabs ended up within other prefab folder, though I duplicated them inside unity.

    Weird.
     
  4. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    14,411
    Yes, and to be blunt you got off easy for it. Any program that has a tendency to play around with the files outside of the editor can cause problems like this. Dropbox is another famous cause of problems like this for people that don't realize Unity behaves this way. We've had people lose the majority of their project before they learned it.
     
    Joe-Censored likes this.