Hi! Just wondering if anyone has any insight into some errors I’m getting.
Basically, I have a project completely working on one computer, and moving it to a new computer - it breaks.
It’s the same exact project and same Unity version. The only difference is the computer.
For context, I installed the Official Netcode for GameObjects from Unity. Selecting the NetworkManager in the Hierarchy causes these issues. This is in Editor and not during Runtime:
Since this is a working official Unity package, I’m guessing it must be on the computer’s side causing this issue. Does anyone know if certain preferences might cause errors like these?
How are you moving it and are the two versions of Unity identical?
If you move stuff around, it’s always best to use proper industrial-grade enterprise-qualified 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:
Here’s how I use git in one of my games, Jetpack Kurt:
Using fine-grained source control as you work to refine your engineering:
Share/Sharing source code between projects:
Setting up an appropriate .gitignore file for Unity3D:
Generally setting Unity up (includes above .gitignore concepts):
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
So for this issue specifically, I have verified that it is the same version of Unity on both machines.
The project is not being moved, it is actually the project taken from the official Unity Netcode for GameObjects. I follow the instructions by using “Add package from git URL…” and grabbing it from com.unity.netcode.gameobjects.
Since it is being grabbed from the same source, I’m assuming it is technically “the same project”. However, like I mentioned, the issue is that this works on one computer, and not the other.
Also, try sniffing around each of the errors: select each one and look in the lower frame on the console (expand it) for the callstack, see if you can figure out who is blowing up and why.
So I realized I did say “moving it to a new computer” in the original post, but I mean more just moving to a new computer, sorry for the confusion
I tried Reimport All like you suggested, but no luck so far.
When I select the offending Object in the Hierarchy, I get 7 errors in total.
As for a few clues, it seems to be an “Editor” bug. Editor comes up a few times in the callstack and again, these errors pop-up when I select the GameObject in the Hierarchy and not during Runtime.
I also see “Array Element is Out of Bounds” which seems like an obvious problem. But again, this same project works perfectly on the other computer, so I doubt it is the script itself that is causing the issue.
Just to add this: I kept having the same problems when I got new computers and would load Unity. Some prefabs that had models created in Blender would rotate and lose all materials. It is a Blender issue. On top of that, the version you created the models with will affect how Unity loads the models. I had updated Blender during development so depending on which version of Blender is installed, when you open a project the models created in the previous version won’t load correctly. You can fix that by uninstalling the current version of Blender, installing the old version of Blender, then re-import the models that were broken.
I’ve looked to see if you can convert old Blender files to the newer version but I haven’t found a way yet.
Unity changed their import script circa 2020 or so. Unity began importing Camera and Light. This meant that entire hierarchies would be stirred if there was only one non-Camera / non-Light model in the file originally.