How to fix broken Cinemachine package?

After I updated Cinemachine to 2.10.3, the scripts started to behave erratically. How can fix it? I have already tried removing and installing it back again (2.10.3), but still doesn’t work. I can’t keep on trial and error because I have many cameras and my settings are all lost.

For example, the Cinemachine Virtual Camera cannot be found when I try to add component to GameObject. The icons are also missing, defaulting to the # script icon instead of the Cinemachine red camera gear icone.

When I add virtual machine via the scene heirarchy context menu, it create a GameObject with the CinemachineVirtualCamera script that is missing the icon. My previous settings are all gone now.

When I try to create a BlendSettings file from context menu in Project window, I get an exception:

failed to create instance of CinemachineBlenderSettings
UnityEngine.Debug:LogError (object)
Cinemachine.Editor.ScriptableObjectUtility:Create (string,string,string) (at ./Library/PackageCache/com.unity.cinemachine@2.10.3/Editor/Utility/ScriptableObjectUtility.cs:96)
Cinemachine.Editor.ScriptableObjectUtility:Create<Cinemachine.CinemachineBlenderSettings> (bool,bool) (at ./Library/PackageCache/com.unity.cinemachine@2.10.3/Editor/Utility/ScriptableObjectUtility.cs:88)
Cinemachine.Editor.CinemachineMenu:CreateBlenderSettingAsset () (at ./Library/PackageCache/com.unity.cinemachine@2.10.3/Editor/Menus/CinemachineMenu.cs:17)

I can create a BlendSettings file from the CinemachineBrain component, but after that, I cannot assign the BlendSettings file to different CinemachineBrains. The one that already has the settings will show this error when assigned:

It feels like you have somehow managed to corrupt your project. What was the version of CM before the upgrade?

If you delete the Library folder and re-open the project, you you get any errors in the console?

My previous version was

"com.unity.cinemachine": {
      "version": "2.10.1",
      "depth": 0,
      "source": "registry",
      "dependencies": {
        "com.unity.test-framework": "1.1.31"
      },
      "url": "https://packages.unity.com"
    },

To be clear, you want me to delete this folder manually from the file system (…\Library\PackageCache), then open the project? What would be the expected result? What’s the worst cast scenario if it fails, will it crash everything I have?

image

They said to delete the whole Library folder. It and everything in it is just a cache and is rebuilt as necessary.

Thanks… It’s processing now… and there’s no estimated time of completion. I remember the last time I accidentally hit Reimport All, I had to wait half a day… I guess I will go out for a run now. :pensive: :thinking:

1 Like

Just reporting back, the problem is resolved with the rebuilding. The reimport was relatively fast, like 5 mins, but when I rebuild the project, it took hours.

1 Like