Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug Cinemachine bug on empty project - Illegal byte sequence encounted in the input.

Discussion in 'Editor & General Support' started by elpatrongames69, Dec 7, 2023.

  1. elpatrongames69

    elpatrongames69

    Joined:
    Mar 2, 2023
    Posts:
    91
    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. Cinemachine.Editor.VcamStageEditorPipeline.OnInspectorGUI (System.Boolean withHeader) (at ./Library/PackageCache/com.unity.cinemachine@2.9.7/Editor/Utility/VcamStageEditor.cs:331)
    3. Cinemachine.Editor.CinemachineVirtualCameraEditor.OnInspectorGUI () (at ./Library/PackageCache/com.unity.cinemachine@2.9.7/Editor/Editors/CinemachineVirtualCameraEditor.cs:163)
    4. UnityEditor.UIElements.InspectorElement+<>c__DisplayClass72_0.<CreateInspectorElementUsingIMGUI>b__0 () (at <64861216782042de93237b5c061bff1b>:0)
    5. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
    6.  
    Code (CSharp):
    1. ExecutionEngineException: String conversion error: Illegal byte sequence encounted in the input.
    2. System.Reflection.RuntimeAssembly.GetCodeBase (System.Reflection.Assembly a, System.Boolean escaped) (at <7ec8e29954a6455daa48484a381ec418>:0)
    3. System.Reflection.RuntimeAssembly.get_CodeBase () (at <7ec8e29954a6455daa48484a381ec418>:0)
    4. System.Reflection.AssemblyName.Create (System.Reflection.Assembly assembly, System.Boolean fillCodebase) (at <7ec8e29954a6455daa48484a381ec418>:0)
    5. System.Reflection.RuntimeAssembly.GetName (System.Boolean copiedName) (at <7ec8e29954a6455daa48484a381ec418>:0)
    6. System.Reflection.Assembly.GetName () (at <7ec8e29954a6455daa48484a381ec418>:0)
    7. Cinemachine.Utility.ReflectionHelpers.GetTypesInAllDependentAssemblies (System.Predicate`1[T] predicate) (at ./Library/PackageCache/com.unity.cinemachine@2.9.7/Editor/Utility/ReflectionHelpers.cs:83)
    8. Cinemachine.Editor.CinemachineVirtualCameraBaseEditor`1[T].OnEnable () (at ./Library/PackageCache/com.unity.cinemachine@2.9.7/Editor/Editors/CinemachineVirtualCameraBaseEditor.cs:114)
    9. Cinemachine.Editor.CinemachineVirtualCameraEditor.OnEnable () (at ./Library/PackageCache/com.unity.cinemachine@2.9.7/Editor/Editors/CinemachineVirtualCameraEditor.cs:40)
    10.  
    upload_2023-12-7_10-11-53.png
    upload_2023-12-7_10-11-44.png
    upload_2023-12-7_10-3-15.png


    The error only occurs when the cinemachine object is selected. It does not appear when another object is selected.
    I opened an empty project for testing, just loaded the cinemachine, and as soon as I created the cinemachine object, the error started to appear, as you can see in the picture.


    upload_2023-12-7_10-10-17.png
    Error video

    Editor log
    https://mega.nz/file/uQcAxLDY#sH-e7upg2-crElbA1BY0DSx0UqIPsMDsC6rK4m0a3kU
     
    Last edited: Dec 7, 2023
  2. elpatrongames69

    elpatrongames69

    Joined:
    Mar 2, 2023
    Posts:
    91
    FOR ANYONE LOOKING
    After i delete rider and switch to visual studio problem solved.
     
  3. MaskedMouse

    MaskedMouse

    Joined:
    Jul 8, 2014
    Posts:
    1,080
    Whether you use Rider or Visual Studio doesn't matter.
    An IDE is just a script editor, not the compiler of your project.
    Whatever the exception was, it probably got solved once the domain reloaded or the editor got restarted.
    You could file a bug report on it though

    Unity 2022.3 uses Cinemachine 3.0.1 so perhaps it was also missing an update of the package.
     
  4. elpatrongames69

    elpatrongames69

    Joined:
    Mar 2, 2023
    Posts:
    91

    Im getting this error since 2 days, first i didnt care that much because it doesnt break anything.

    - I already restart computer a lot of times
    - I downloaded diffrent versions of rider even 2022 ones, still same error

    Once i delete rider from computer and change to visual studio problem getting fixed.
     
  5. MaskedMouse

    MaskedMouse

    Joined:
    Jul 8, 2014
    Posts:
    1,080
    And for me everything works as expected.
    I created a new project using the Core URP template.
    I added Cinemachine 2.9.7 via the package manager
    I added a virtual camera to the scene.
    It works normally and I use Rider 2023.3.

    I look at the actual code that gives the null reference and it is the
    m_subeditors
    that is being null somehow. This should've been initialized when the editor booted up.
    Which means something else prevented initialization and the issue may be even deeper than the console is telling you.

    Since in your editor screenshot the Unity Source Control button is also empty, you might have a corrupt Unity install.
    Have you tried reinstalling the editor through the Unity Hub?

    Also you might want to attach the editor log to the initial post. Perhaps something isn't getting logged in the console but is happening in the editor.

    upload_2023-12-7_15-54-39.png
     
    elpatrongames69 likes this.
  6. elpatrongames69

    elpatrongames69

    Joined:
    Mar 2, 2023
    Posts:
    91
    Thank you i attached editor.log to post. Yes i downloaded 3 diffrent versions and problem happened on all, even in 2021 version.
    Version controls logo is missing but its working when i click it, i dont know if its related it can be maybe.
    upload_2023-12-7_16-37-26.png

    There are plugins such as Odin Inspector in my main project. Could these have somehow corrupted the unity? However, if that were the case, it shouldn't appear in the project I just opened in the editor I just downloaded, but it does.

    I recorded a video to show problem on newly opened project. The strange part is that it gives the error only when I select the cinemachine camera.

     
  7. MaskedMouse

    MaskedMouse

    Joined:
    Jul 8, 2014
    Posts:
    1,080
    Well one thing that I saw immediately is that you're using OneDrive as your project location.
    Since syncing with OneDrive is going very slow, locks files and such, this can cause some issues.
    The same goes for Dropbox. Don't use live file syncing services with Unity.

    If you need to backup your project use proper source control. i.e. Git.
    Github for example you can manage your project easily.
    You push the changes yourself once you're done with them.
    It can even be done from within Rider.

    So try creating a new project outside of OneDrive. i.e.
    C:/UnityProjects/
     
    elpatrongames69 likes this.
  8. elpatrongames69

    elpatrongames69

    Joined:
    Mar 2, 2023
    Posts:
    91



    Oh yes, maybe this could be it.
    Actually, I don't use OneDrive, I do it via Git, as you said.
    However, Windows automatically syncs my desktop with OneDriver, maybe it is due to a setting I turned on without realizing it before. Since my projects are kept on the desktop, this may be causing the problem.
    Thank you very much for your help, I am not available right now but I will test it on Monday.
     
  9. elpatrongames69

    elpatrongames69

    Joined:
    Mar 2, 2023
    Posts:
    91
    Yes, the problem was indeed caused by OneDrive. The problem was solved when I moved the project to another location. I think it started synchronizing the desktop automatically because I entered my Microsoft account while installing Windows.

    However, I still couldn't understand why I was getting this error only when using the rider or clicking on the cinemachine object.

    Thanks again for your help
     
    MaskedMouse likes this.