Search Unity

Unity Update Broke Game

Discussion in 'Editor & General Support' started by SuccessFail, Mar 25, 2021.

  1. SuccessFail

    SuccessFail

    Joined:
    Jan 14, 2021
    Posts:
    23
    I just updated from 2019.4.18 to 2019.4.23 because Unity kept asking me to but after I did several assets stopped working. Most notably my player stopped being able to walk and my camera refuses to follow anything, via script or making it a child. Did this update change anything that could potentially cause these issues? I'm heavily considering starting from scratch which is less than ideal
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,300
    Its hard to answer that question without details. Do you have errors when the game runs? Does it still work if you open it in 2019.4.18?
    Are you using source control, did something change when you upgraded?
     
  3. PeachyPixels

    PeachyPixels

    Joined:
    Feb 17, 2018
    Posts:
    713
    Hi Karl,

    I've just updated from 2019.4.22f1 to 23f1 and upon opening my project, all assets were re-imported (which is unusual for that scenario) and the game is displaying numerous issues now.

    Upon investigation, it seems a lot of mono behaviours fields (in prefabs) were stripped of some\all of their values. For example, a pickup has a PickupManager class that references (in the editor) a Rigidbody or Audio Source (on the same Game Object) but the fields are now null.

    What's even more odd is that GitHub is reporting only one change, that being the usual ProjectVersion.txt file.

    So is this a prefab\editor issue?
     
    Last edited: Mar 25, 2021
  4. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,300
    Can you file a bug report?
     
  5. PeachyPixels

    PeachyPixels

    Joined:
    Feb 17, 2018
    Posts:
    713
    Hi Karl,

    Apologies, but not immediately.

    A game of mine has just gone into beta and I've hit a show stopping Unity IAP \ MS Store issue. So I'm dealing with that right now. I probably can in a few days time. So sorry.
     
    karl_jones likes this.
  6. PeachyPixels

    PeachyPixels

    Joined:
    Feb 17, 2018
    Posts:
    713
    Scratch that... I've logged it. Seems quite a fundamental issue, so thought it was warranted. Quick and easy to log as well. Good luck!
     
    karl_jones likes this.
  7. lejean

    lejean

    Joined:
    Jul 4, 2013
    Posts:
    392
    Same here, waiting for it to finish now to see if anything is broken.
     
  8. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,749
    This smells like maybe you just need to reimport all, if there really were no other changes.
     
  9. lejean

    lejean

    Joined:
    Jul 4, 2013
    Posts:
    392
    Nothing broke as far as I can tell, only the post processing package was still outdated while it would be updated to 3.1
     
    PeachyPixels likes this.
  10. PeachyPixels

    PeachyPixels

    Joined:
    Feb 17, 2018
    Posts:
    713
    Thanks Kurt.

    That may well be the case. But Unity already ran one by the looks of it, which is unusual in itself for a minor update.

    Given that the editor was indicating fields had been null'ed but GitHub was reporting no deltas to the associated files, I'm guessing it's a prefab and\or editor issue.

    I'm up against at the moment, so will try again with 23f1 next week and see if I can re-produce.
     
  11. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    For most people who don't have a lot of experience in the software industry, source control seems like an unnecessary hassle. But this is a prime example of why it is the industry standard. How this situation should normally go is you investigate the issue for a bit, but when you're bored of that you just use source control to revert your project (or check out an entire new copy of the last revision of your project) and go back to 2019.4.18 like nothing happened. Maybe you lose an hour of your time.

    Far less efficient, but still useful, is just making frequent backups of your project. Just create a zip file of your entire project folder. If something bad happens, you just delete your current project folder and replace it with the backup. If you're doing it this way you should make a backup after making any significant progress, and before making any major change. Changing Unity versions is always a major change, since Unity doesn't natively support downgrading versions after an upgrade.

    But to help you from here, we would need to know more details. Are you getting any console errors? Do you see anything saying a component is missing when you view the relevant GameObjects? When you create a new scene and test these same scripts in isolation, do they function there?
     
    Kurt-Dekker likes this.
  12. SuccessFail

    SuccessFail

    Joined:
    Jan 14, 2021
    Posts:
    23

    The advice you have given here with source control is already more than enough honestly, this is my first game ever and I have no experience or people to teach me.

    As for in game the player and main camera prefabs don't work in new scenes and I have yet to receive any error message for anything. The thing that concerns me is I created a new camera, made it a child of the player, and it still didn't follow him. It feels like an issue with .23 and my MacBook
     
    Joe-Censored likes this.
  13. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,749
    Hmm, go do that again.

    - Stand here. Look at the camera offset in the inspector

    - Walk over there. Look at the camera offset in the inspector.

    How do those quantities differ?

    Do you perhaps have TWO cameras in the scene?

    This MIGHT be... what happens if you just whip back to 22?
     
  14. SuccessFail

    SuccessFail

    Joined:
    Jan 14, 2021
    Posts:
    23
    Upon further testing I managed to get it to work as a child of the player (movement speed got reset on the update so it was unable to move), but it still won't move with the follow target script. Any ideas on why one works but not the other?
     
  15. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,749
    Whip out that script and start digging into it: check that all the Inspector fields are what they should be, etc.

    Also, give it a run, see what that target script is doing. I recommend liberally sprinkling Debug.Log() statements through your code to display information in realtime.

    Doing this should help you answer these types of questions:

    - is this code even running? which parts are running? how often does it run?
    - what are the values of the variables involved? Are they initialized?

    Knowing this information will help you reason about the behavior you are seeing.
     
  16. pistoleta

    pistoleta

    Joined:
    Sep 14, 2017
    Posts:
    539
    Have same problem here. Cant even count how many stuff has been broken. mostly UI, its like 30% of the UI has disappeared or been messed and scripts that never gave a problem before are simply missing....

    We are rolling back to .22 , no time to figure out all the details of what the heck happenned. Just letting you know it happened the same to more people.

    Regards
     
  17. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,300
    Please file bug reports if something has broken .
     
  18. PeachyPixels

    PeachyPixels

    Joined:
    Feb 17, 2018
    Posts:
    713
    That's exactly the behaviour that I experienced post-upgrade.

    Are you seeing missing fields on your components (MonoBehaviour derivatives)?

    Did you upgrade from 22f1 or an earlier version?

    Did you see any deltas in your change control solution (if you're using ones)?

    Karl, 23f1 sounds fundamentally broken to me (under some scenarios) so you may want to consider pulling it. In three years of working with Unity (and mostly weekly updates) I've never seen an upgrade break a project like this.
     
  19. pistoleta

    pistoleta

    Joined:
    Sep 14, 2017
    Posts:
    539
    Just reimported all assets and everything seems to be working again fine.
     
    PeachyPixels likes this.
  20. PeachyPixels

    PeachyPixels

    Joined:
    Feb 17, 2018
    Posts:
    713
    Thanks for the update, I'll try again next week if 23f1 is still available and report back.

    Sounds like the forced re-import on upgrade corrupted the library\cache.
     
  21. msjoberg

    msjoberg

    Joined:
    Jan 31, 2018
    Posts:
    4
    We have the same problem. Upgraded from Unity 2019.4.22f1 to Unity 2019.4.23f1 and various prefabs gets some fields nulled out and it isn't detected as a change until you go in and save the prefab. We downgraded to 2019.4.22f1 and will wait for a fix.

    As a side note in Unity Cloud Build we had set "use latest Unity 2019.4 version" and the binaries produced from UCB stopped working when they used 2019.4.23f1 (even without code changes on our end)
     
    PeachyPixels likes this.
  22. pistoleta

    pistoleta

    Joined:
    Sep 14, 2017
    Posts:
    539
    we just decided to move on 2020.3.1 LTS, I think its a bit early but lets see what happens
     
    PeachyPixels likes this.
  23. PeachyPixels

    PeachyPixels

    Joined:
    Feb 17, 2018
    Posts:
    713
    I did consider that, but am days away from launch so decided to hold off for now :)
     
  24. SuccessFail

    SuccessFail

    Joined:
    Jan 14, 2021
    Posts:
    23

    Dude you're the best. Everything is up and running back to normal. Some values within the code also got set to zero, preventing movement. As a first time developer the small things make it so much easier, like the debug code which I did not know about. Keep being awesome man, thanks a ton
     
  25. nikescar

    nikescar

    Joined:
    Nov 16, 2011
    Posts:
    165
    This same issue happened to us as well. Luckily the project didn't lose all references on prefabs on my PC but on my brother's it broke the project. Had to delete the local project and redownload from Collab. Even that process didn't go smoothly. All his project settings were set to defaults.
     
  26. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,749
    Personally I use git because it is free and there are tons of tutorials out there to help you set it up. Properly configured with the right .gitignore file, it will allow you to replicate your project wherever you want, and revert it to any previous state you care to see.

    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
     
    Joe-Censored likes this.
  27. nikescar

    nikescar

    Joined:
    Nov 16, 2011
    Posts:
    165
    I appreciate the info but that was more of an aside with the topic of this thread being Unity updates breaking projects
     
  28. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,749
    and my quote was more of an aside to this:

    which is why I quoted it. With git I can give the repo URL to somebody on the moon and they can download it and instantly build the project exactly as I have it checked in, settings and all.

    Sounds like (maybe) Collab doesn't quite do that, based purely on your brother's experience. (I have never used Collab; I have git).

    Correction: software updates in general break projects. It's far from just being a Unity thing and in fact, Unity does far better than your average game engine does at not breaking stuff from update to update, or at least not seriously breaking stuff beyond a few minor tweaks and twiddles.

    But of course, YMMV.
     
    nikescar likes this.
  29. PeachyPixels

    PeachyPixels

    Joined:
    Feb 17, 2018
    Posts:
    713
    Hi Karl,

    I just tried 2019.4.24f1 and am seeing the same behaviour and the same issue as 2019.4.23f1

    Upon opening the (4.22f1) project (in 4.24f1) an import is triggered and a large number of components (on prefabs) have their fields nulled. GitHb report no deltas (other than those expected) which leads me to believe it's a corrupt cache\library.

    That's the second LTS build that's displaying a major bug (IMO) and the second LTS build that I'm skipping as a result.

    FWIW the bug report I filed appears to have had zero movement in terms of investigation or resolution.

    At the very least, is it possible to confirm that a full re-import fixes (as others have reported) the issue and should have no side-effects please?

    Can anybody else upgrading from pre 4.22f1 (or earlier) to 4.23f1 (or later) confirm the same behaviour please?

    Update:

    Just spotted another post on this...

    https://forum.unity.com/threads/uni...renceexception-argumentnullexception.1089346/

    It's marked as resolved (e.g. full re-import) but is the route cause (import bug?) not being investigated?
     
    Last edited: Apr 9, 2021
  30. PeachyPixels

    PeachyPixels

    Joined:
    Feb 17, 2018
    Posts:
    713
    Hi Karl or anyone from Unity really,

    I just attempted to update a project to 2019.4.25f1 and still the problem exists. So this is now the third LTS build in a row that is fundamentally broken for me.

    This is what happens...

    1. Update project from 2019.4.22f1 to 2019.4.25f1 (a re-import is automatically triggered)

    2. The auto re-import strips a large number of field references (to other in-scene components) from a lot of prefabs (GitHub deltas are as expected, only ProjectVersion.txt) but the game is obviously completely broken.

    3. I perform a manual re-import (to fix the broken prefab references) at which point GitHub is now reporting over 120 source file deltas (see attached screenshot for example)

    So the issues are...

    1. Why is the upgrade auto re-import being triggered and why is it corrupting the library\cache? (e.g. striping prefab field references)

    2. Why is the manual re-import updating source files?

    I've tried to give as much information as possible in these posts. I've logged a bug as requested. I've posted about it on the prefabs forum as well...

    https://forum.unity.com/threads/unity-upgrade-prefab-issue-null-references-corrupt-cache.1093165/

    All have fallen on deaf ears and I've just been met by silence. It's incredibly frustrating, especially when I'm trying to help.

    Something fundamentally broke between version 22f1 and 23f1 and the same issue is also present in the 2018, 2020 & 2021 versions as well (judging by the forum posts I've read)

    Please can someone at-least acknowledge that this is an issue and is being looked into.
     

    Attached Files:

    Last edited: Apr 23, 2021