Search Unity

Bug Same Project, Same Version, Two different computers = Errors

Discussion in 'Editor & General Support' started by Mo-osh, Mar 30, 2022.

  1. Mo-osh

    Mo-osh

    Joined:
    Dec 16, 2012
    Posts:
    5
    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:

    Screenshot 2022-03-25 065052.png

    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?
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,689
    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:

    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. Mo-osh

    Mo-osh

    Joined:
    Dec 16, 2012
    Posts:
    5
    Hey wow, thanks for all the insight!

    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.
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,689
    Hm, weird. Perhaps you just need a reimport all?

    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.
     
  5. Mo-osh

    Mo-osh

    Joined:
    Dec 16, 2012
    Posts:
    5
    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.

    Any clue what's going on here?

    Error-01.png

    Error-02.png
     
  6. sairaj9396

    sairaj9396

    Joined:
    Nov 7, 2022
    Posts:
    4
    Hey guys! Was this resolved by any chance? What was done to fix it. I am kind of in the same situation. :(
     
  7. sairaj9396

    sairaj9396

    Joined:
    Nov 7, 2022
    Posts:
    4
    Turns out installing Blender resolved the issue. There were some .blend files in the build. Hope this helps people in the future.
     
  8. Alcanteria

    Alcanteria

    Joined:
    Jul 25, 2013
    Posts:
    3
    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.
     
  9. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,689
    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.

    Here's more reading:

    Costs of Blender vs FBX:

    https://forum.unity.com/threads/any-cons-to-keeping-models-as-blend-files.1345850/#post-8497010

    Unity imports Blender3D objects as FBX via a little Python script:

    https://forum.unity.com/threads/from-blender-to-unity-problem.1073381/#post-6925811

    The Python script that Unity uses (substitute your Unity version number or search) to import:

    ./Hub/Editor/2020.2.1f1/Unity.app/Contents/Tools/Unity-BlenderToFBX.py


    More on fixing it: (see this link below v v v)

    https://forum.unity.com/threads/all-my-mesh-folder-content-is-gone.1102144/#post-7094962

    Blender3D objects used as trees / detail in Unity3D terrain (See the second half of this response)

    https://forum.unity.com/threads/ter...trees-made-with-blender.1112119/#post-7155631

    https://forum.unity.com/threads/all...nging-parent-in-blender.1159283/#post-7442123

    Probuilder and Probuilderize and Blender:

    https://forum.unity.com/threads/probuilder-vs-blender.462719/#post-8060462

    Some more potentially-useful info:

    https://forum.unity.com/threads/orientation-problem.1265834/#post-8037734

    Updating Blender files without breaking your prefabs:

    https://forum.unity.com/threads/is-it-possible-to-edit-a-prefab-in-blender.1426326/#post-8954421

    When I work in Blender3D for Unity3D use, I follow these organizational rules:

    - use Empty Blender Objects as folders: they come out as an extra GameObject

    - ALWAYS parent everything to a single Empty, even a single object

    - put as few objects in a given .blend file as possible, combining them in Unity into a prefab

    - set good names for your Blender3D objects and NEVER RENAME them after Unity sees them

    - don't even think about Materials or Textures in Blender, just do it in Unity