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

Unity Hub suddenly changed editor version for project?

Discussion in 'Unity Hub' started by Mornedil, Feb 24, 2024.

  1. Mornedil

    Mornedil

    Joined:
    Feb 7, 2016
    Posts:
    22
    After closing my project, the next time I went to open it, Unity Hub had a message saying it was last saved with version 5.3.4f1.

    The only version of Unity I have installed is 2022.3.19f1 (this computer was set up only a month ago and have never had any other Unity versions installed).

    I already changed the Editor Version back to 2022.3.19f1 so that's solved. But I'm curious what would cause Unity to think it was saved with an old version? And if it could potentially affect the project files in any way? (I noticed Unity had to load longer than usual when changing editor version).

    (the last thing I did before closing the project was building lightmaps, and then I went to restart the project. When closing the project, it asked me to save the current scene to which I pressed Yes).
     
  2. bugfinders

    bugfinders

    Joined:
    Jul 5, 2018
    Posts:
    2,017
    well it is just a text file, but i did see for example one asset i downloaded overwrote a whole ton of the project setup files so something like that could have accidentally included the version.. or if you followed a tutorial that said "unzip this here" that may have contained a version change
     
    angrypenguin likes this.
  3. Mornedil

    Mornedil

    Joined:
    Feb 7, 2016
    Posts:
    22
    Thank you! That must have been it. I extracted some project settings from an old project into my current project, which must have overwritten the editor version
     
  4. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    6,505
    Broken or missing content in the ProjectSettings folder.
    The editor version is stored in ProjectVersion.txt, you probably overwrote that.

    Copying settings assets from another project that was built with a different editor version is not something that you should do without having a backup of the project, without extensive testing, and ideally you'd do it selectively (eg only replace player or quality settings for instance).

    There's also a risk that settings change to a conflicting state that you could never get to using the UI and there's no way of telling how Unity might handle this situation. This can lead to a case of representing false state in the UI, like a checkbox that is checked but its setting is off, until you deselect and recheck the checkbox.
     
  5. Noisecrime

    Noisecrime

    Joined:
    Apr 7, 2010
    Posts:
    2,057
    Yikes, that is a high risk strategy and honestly something that should never be required. I'd be a bit wary of that project having some weird behaviors in the future.

    That is not to say there isn't ever a need to 'move' settings between projects or versions of a project, but it should really be done at a much finer granularity than simply copying files. If you find a need to do so I would suggest using software dedicated to merging files, for example WinMerge is very popular and useful on Windows. It can compare entire folders, files, or the contents of files, making it pretty easy to copy/exchange down to per line parameters. Though generally I would only use it to see differences between the settings but actually make changes within the actual Unity editor to the project to make them match. Obviously you should always have a back up or svn before doing so.
     
    Ryiah and CodeSmile like this.
  6. DragonCoder

    DragonCoder

    Joined:
    Jul 3, 2015
    Posts:
    1,743
    Btw. I'd not be surprised if Unity could not read a version or valid config at all and took that Unity 5 as a default since it may have been the last version after which the configuration format was changed.
    I have seen that version (at least some Unity 5) on opening corrupted projects before...
     
    Last edited: Feb 26, 2024
    Ryiah and Noisecrime like this.
  7. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,815
    You should never move just things between projects.

    You should instead package relevant files from one project and unpackage them in desired project.

    Secondly, if you had a version control setup, you would know straight away what is going on. So make yourself favour, and setup vs ASAP, before you do any further work. It will save you tons of time in future development.
     
    Ryiah and Noisecrime like this.