Search Unity

UNITY JUST WRECKED MY PROJECT?!?!?!

Discussion in 'Editor & General Support' started by VRKid, Feb 13, 2022.

  1. VRKid

    VRKid

    Joined:
    Jul 1, 2016
    Posts:
    42
    Everything was working fine 10 minutes ago. I moved a script into a folder and suddenly I have 99+ errors that my scripts don't exist. They are all right where they were a minute ago but the Editor is telling me they don't exist and suddenly, the code window has a ton of errors. What the duck, unity this is 10 MONTHS of work and the system is completely locking up on me. I have absolutely nothing to show for all my time. All the scripts have 'decoupled' from the objects and when I try to re-add them, I'm told they 'don't exist'. My game was running fine just before this happened, whats going on ?!?!?!
    upload_2022-2-13_14-11-19.png

    upload_2022-2-13_14-12-43.png

    upload_2022-2-13_14-14-17.png

    upload_2022-2-13_14-14-43.png
     

    Attached Files:

  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,689
    First, close Unity and back up your entire project. I'll take it from the tone of your post that you are not properly using source control. You should consider changing that in the future. See below.

    However, AFTER you back up your project, then return to Unity.

    In Unity, 100% of all your code MUST COMPILE SUCCESSFULLY before you can use any of it.

    Step 1: try a reimport all.

    Step 2 (if the above fails): go to the first error in the log and just investigate the error

    The complete error message contains everything you need to know to fix the error yourself.

    The important parts of the error message are:

    - the description of the error itself (google this; you are NEVER the first one!)
    - the file it occurred in (critical!)
    - the line number and character position (the two numbers in parentheses)
    - also possibly useful is the stack trace (all the lines of text in the lower console window)

    Always start with the FIRST error in the console window, as sometimes that error causes or compounds some or all of the subsequent errors. Often the error will be immediately prior to the indicated line, so make sure to check there as well.

    All of that information is in the actual error message and you must pay attention to it. Learn how to identify it instantly so you don't have to stop your progress and fiddle around with the forum.

    Remember: NOBODY here memorizes error codes. That's not a thing. The error code is absolutely the least useful part of the error. It serves no purpose at all. Forget the error code. Put it out of your mind.

    I'm sorry you've had this issue. Please consider using proper industrial-grade source control in order to guard and protect your hard-earned work.

    Personally I use git (completely outside of Unity) because it is free and there are tons of tutorials out there to help you set it up as well as free places to host your repo (BitBucket, Github, Gitlab, etc.).

    You can also push git repositories to other drives: thumb drives, USB drives, network drives, etc., effectively putting a complete copy of the repository there.

    As far as configuring Unity to play nice with git, keep this in mind:

    https://forum.unity.com/threads/prefab-links-keep-getting-dumped-on-git-pull.646600/#post-7142306

    Here's how I use git in one of my games, Jetpack Kurt:

    https://forum.unity.com/threads/2-steps-backwards.965048/#post-6282497

    Using fine-grained source control as you work to refine your engineering:

    https://forum.unity.com/threads/whe...grammer-example-in-text.1048739/#post-6783740

    Share/Sharing source code between projects:

    https://forum.unity.com/threads/your-techniques-to-share-code-between-projects.575959/#post-3835837

    Setting up an appropriate .gitignore file for Unity3D:

    https://forum.unity.com/threads/removing-il2cpp_cache-from-project.1084607/#post-6997067

    Generally setting Unity up (includes above .gitignore concepts):

    https://thoughtbot.com/blog/how-to-git-with-unity

    It is only simple economics that you must expend as much effort into backing it up as you feel the work is worth in the first place.

    "Use source control or you will be really sad sooner or later." - StarManta on the Unity3D forum boards
     
  3. VRKid

    VRKid

    Joined:
    Jul 1, 2016
    Posts:
    42
    I have no idea what source control is, but I will soon. The top error is the same as every other error. Can't locate TMPro and for some reason the Unity Engine library? I don't even know how to fix that, but I'm following your post... omg this will take forever to redo. ugh.
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,689
    TMPro is TextMesh Pro.

    It usually comes from the Unity package manager.

    Can you open the Package Manager and remove it, then re-add it?

    If you cannot, then perhaps try flushing the package cache and doing a reimport all.

    https://stackoverflow.com/questions/53145919/unity3d-package-cache-errors/69779122

    If that fails, then create a new project somewhere else and when it finishes opening and becomes quiescent, close that Unity and copy this file from the new project:

    Packages/manifest.json


    Over to replace the one in your current project, then reopen Unity.
     
    VRKid likes this.
  5. VRKid

    VRKid

    Joined:
    Jul 1, 2016
    Posts:
    42
    I 'fixed' it. Thank you Kurt. I will tell you what I did... this makes zero sense to me, I almost wonder if this is a bug or a virus.

    So I'm using Simplemans -> CoroutineExtensions.
    I moved the Core files out into my main SCRIPT FOLDER.
    Suddenly everything uncoupled from all my objects and NONE of my scripts worked, even the ones that had nothing to do with the Simpleman co-routines.

    I deleted all the references to the co-routines in the scripts and moved the script files from the main SCRIPT FOLDER into their old places and MAGICALLY all of the errors resolved and all of the scripts went back to the objects. EVEN the ones I removed trying to figure out what was going on.

    I think my computer is haunted.
     
  6. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,689
    All computers are haunted. Why do you think there are so many zombie games?

    Hie thee to git and learn how to put your project under source control before another disaster occurs.
     
    VRKid likes this.
  7. VRKid

    VRKid

    Joined:
    Jul 1, 2016
    Posts:
    42
    I don't know what happened, but I'm handing in my project AS IS, bugs and all... not tempting fate this time.
     
  8. VRKid

    VRKid

    Joined:
    Jul 1, 2016
    Posts:
    42
    I'll do that now, thank you for your replies. Its actually not about Zombies, I decided to go with Alien Cats instead. :D