Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Discussion I've been updating my unity project since Unity 2017, what files should I just remake?

Discussion in 'General Discussion' started by sacb0y, Jan 9, 2024.

  1. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    936
    I've been upgrading my project through unity versions since Unity 2017, obviously the game was just me messing around in 2017, but I still carried the project to 2018, 2019,2021 and now 2022 and soon 2023.

    I've noticed this caused some issues with files over time. For example, there was a horrible bug caused by an old input system file. Remaking the file with the same config entirely fixed the bug.

    There's been other things too, bad renderer configs for URP, other stuff. Less a config issue more some sort of meta data corruption.

    What sort of other things have you guys noticed over upgrades that broke and only needed a file remade? I've been testing unity 2023 and woo boy does it love to crash with my project. I feel like I should just remake the project file lmao. Copy things over one at a time and reimport everything.
     
  2. IllTemperedTunas

    IllTemperedTunas

    Joined:
    Aug 31, 2012
    Posts:
    782
    Well, it's good to have an organized file structure anyway. Have all your art in one main folder. Have all your scripts in another, all your prefabs and lvls, etc. Do that well and you'll eventually end up with one folder called "settings" or something akin to that, and just dump all your settings in here for camera, etc.

    Then you'll find that the only thing that really makes your project unique and tied to that "Project" is the existing scene files, which you could make into a prefab with nested prefabs... So imagine you create an empty object in your scene, child everything under it and make it into a prefab. That prefab is now your existing scene, just without all the scene settings if that makes sense. If you dropped that into a new scene, right clicked it and choose "unpack" (not completely) you will have the same assets in that new scene.

    So point is, you can upgrade to the latest unity, create a totally fresh project with no baggage, then dump all your folders from the other project in, dump the prefabs that define your scenes/ levels and boom, you'll have a super clean bare bones version of Unity with your stuff from your other project. You MIGHT have to use the package exporter to get this to work while selecting all the needed assets, not sure if you can just dump the folders in.

    Some things you may need need to set up from scratch depending on if they translate or not: Camera and post processes, scene lighting settings within the inspector, build settings and honestly that's about it.

    You can use windowskey + shift + s to take screenshots of inspector windows from your old scenes so you can see what your old settings were, load up your new build and punch them in again.

    TLDR: Make everything into prefabs that you can, organize your scene into folders (this is good advice anyway regardless of moving to a new unity version) Make a fresh scene and dump your prefabs in.

    I've been through this process before and this was the workflow I used. But honestly there doesn't tend to be any critical file that will screw up your project, though there could certainly be some setting in the build options or camera settings or who knows where that might be buggering your project.
     
    Last edited: Jan 9, 2024
    sacb0y likes this.
  3. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 5, 2024
    Posts:
    534
    Is it on DX12 by any chance? I even have to set DX11 for package development projects which have nothing to do with graphics at all, because it just loves to crash and burn.
     
    Ryiah likes this.
  4. DragonCoder

    DragonCoder

    Joined:
    Jul 3, 2015
    Posts:
    1,743
    Have you done the regular "reimport all assets" already, and more importantly, deleted the Library folder (before restarting)?
     
    Antypodish likes this.
  5. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    936
    yeah but thats not good enough I think.

    Some stuff needs meta files regenerated and everything I think.
     
  6. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    936
    this isn't a problem in 2022, so i would presume it's not an issue in 2023.

    Most DX12 problems i encountered were ultimately driver issues.
     
  7. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    936
    I plan to tackle this soon when Unity 6 preview comes out. Since that represents the most significant change.
     
  8. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,672
    I almost never have any significant problem updating a Unity project.

    The most difficulty I ever had updating an old project was one that had old pre-Package-Manager ProBuilder and TextMeshPro components, Thankfully Unity provides instructions for upgrading projects with both of these to the modern Package Manager versions. These instructions are on forum sticky posts you can find if you google.

    These processes both require some preparation, so if you just attempt to upgrade project naively then these don't work (too late to fix it after the fact), but I simply restored the project from a back-up and started over again.
     
  9. bugfinders

    bugfinders

    Joined:
    Jul 5, 2018
    Posts:
    2,021
    Ive taken my project of long term fiddle (eg im working on it, well technically i dont think I have actually majorly added or changed anything this year) but its currently in unity 6b11, and started long before 2017 was a thing, its just something i do when in the mood.. anyway, its doing fine.. It did cry and go into safe mode when textmeshpro was no longer a package specifically and it had the old tmp essentials, but deleting those, and patting it gently it moved on just fine
     
  10. steego

    steego

    Joined:
    Jul 15, 2010
    Posts:
    969
    I always have these two methods in all my projects for this

    Code (CSharp):
    1.         [MenuItem("File/Reserialize All Assets", false, 179)]
    2.         private static void ReserializeAllAssets()
    3.         {
    4.             AssetDatabase.ForceReserializeAssets();
    5.         }
    6.        
    7.         [MenuItem("File/Reserialize Selected Assets", false, 180)]
    8.         private static void ReserializeSelectedAssets()
    9.         {
    10.             var selectedPaths = Selection.objects
    11.                 .Select(o => AssetDatabase.GetAssetPath(o))
    12.                 .Where(p => !string.IsNullOrWhiteSpace(p));
    13.            
    14.             AssetDatabase.ForceReserializeAssets(selectedPaths);
    15.         }
     
    spiney199, Ryiah and sacb0y like this.