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

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



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.


Error video

Editor log

FOR ANYONE LOOKING
After i delete rider and switch to visual studio problem solved.

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.

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.

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.

1 Like

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.
9516742--1341718--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.

https://www.youtube.com/watch?v=lK0kV2Kl04A

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/

1 Like

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.

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

1 Like