Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

New to Unity 2018.1 - Package Manager

Discussion in 'Cinemachine' started by Adam_Myhill, Mar 9, 2018.

  1. Adam_Myhill

    Adam_Myhill

    Joined:
    Dec 22, 2016
    Posts:
    342
    Those of you on the 2018.1 betas may have noticed a new huge feature: Package Manager

    upload_2018-3-8_16-27-12.png

    This is where many Unity Packages will be held and it's where the latest version of CM is being delivered
    upload_2018-3-8_16-28-20.png

    Cinemachine will still live on the Asset Store, at least for a while, but will no longer be updated there ending with version 2.1.10. The latest versions of CM will now be delivered via the Package Manager.

    You can see there's already been two CM updates with improvements and new features from what's currently on the Asset Store.

    Over time, more and more Unity systems will move here as it allows us to update each module/package more frequently than through Unity mainline. It also allows people to configure lighter installs of Unity with just the packages needed for any given type of project.

    Thanks a bunch!
     

    Attached Files:

    Corvwyn, discofhc and JakubSmaga like this.
  2. Adam_Myhill

    Adam_Myhill

    Joined:
    Dec 22, 2016
    Posts:
    342
    Also, there's a pretty big new feature in there. We're announcing the release at GDC... but I can't stop you from having a mess around if you find it.... Look under 'Extensions' for any vcam
     
    hippocoder likes this.
  3. Duusty

    Duusty

    Joined:
    May 14, 2013
    Posts:
    56
    Whats the best way to set this up with assembly definitions?
    Especially as the Postprocessing Adaptor would require the dependency as well if we want to clean up our project folder.

    Also another thing i would like to mention, its currently quite hard to change the input adapter for the freelook camera (in case you dont want to use unity input). You cant easily copy the whole content of the freelook camera script as most of the functions required a marked internal for Cinemachine. And even after changing those methods to public your missing the custom editor functionality to change all of the 3 subcam properties for the freelook camera.
     
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,623
    Actually it's very easy. No code copying required. Look in CinemachineCore for the input override delegate.
     
  5. Duusty

    Duusty

    Joined:
    May 14, 2013
    Posts:
    56
    ouh nice, awesome havent seen this :)

    Also could you tell me the exact name of the cinemachine assembly to setup my dependencies? I would expect something like Unity.Cinemachine?
     
  6. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,623
    Assemblies are "Cinemachine" and "Cinemachine.Editor"
     
  7. sebsmax

    sebsmax

    Joined:
    Sep 8, 2015
    Posts:
    118
    I've tried it, here what i got:

    • migrating to this version break all the cameras in the project
    • in the new package manager, the Cinemachine 2.1.10 install was not detected, So and I had to make a new install and then the console was spawning error everywhere as two Cinemachine were in the project.
    • In the project, when doing "Edit script", it lead to a broken script
    • I realized that it's possible to find the source code in C:\ProgramData\Unity\cache\packages\packages.unity.com\com.unity.cinemachine@2.1.12\Runtime\Behaviours

    Also that's a minor issue, in the doc you have faulty characters "�����" everywhere
    https://docs.unity3d.com/Packages/com.unity.cinemachine@2.1/manual/index.html
     
    Last edited: Mar 18, 2018
  8. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,513
    how about a small thumbnail for each package in the list?
     
  9. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,623
    Thanks for the feedback. You can upgrade without breaking all your cameras if you do it this way:
    1. First delete the Cinemachine package from your project
    2. Then install Cinemachine from the package manager
    This is because Package Manager CM re-uses the same metafile IDs, specifically in order not to break existing projects. If you install the package manager version without first deleting the old install, all the metafile IDs will get remapped, and the result is what you got.

    And thanks for the note about the manual. It seems that all the apostrophes got mangled somewhere in the pipeline. We'll look into it.
     
    Last edited: Mar 18, 2018
  10. sebsmax

    sebsmax

    Joined:
    Sep 8, 2015
    Posts:
    118
    As consoles plugins don't support 2018.1 yet, I need to stay on unity 2017.3 for now. So in the end, I just took the install of Cinemachine 2.1.12 and moved it in my Unity 2017.3 project.

    It work just fine!
     
  11. zhuxianzhi

    zhuxianzhi

    Joined:
    Mar 30, 2015
    Posts:
    122

    hi,sebsmax.

    I try to use your way, edit mode works, but not build? Any solution? Thanks in advance.

    Error:
    ArgumentException: The Assembly UnityEditor is referenced by Cinemachine ('Assets/Plugins/Cinemachine.dll'). But the dll is not allowed to be included or could not be found.
     
  12. iamarugin

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    880
    I installed Posprocessing v2 via Package Manager and then Cinemachine. But I can't fond the CinemachinePostProcessing component. What should I do to get it back?
     
  13. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,623
  14. Alexsandro-Natsume

    Alexsandro-Natsume

    Joined:
    Apr 20, 2015
    Posts:
    22
    for those who are using a older version of unity but are having a problem with cinemachine.
    what are we suppose to do?
     
  15. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,623
    Ask here on the forum about your problem, we will try to help!
     
  16. Alexsandro-Natsume

    Alexsandro-Natsume

    Joined:
    Apr 20, 2015
    Posts:
    22
    when my camera with the cinemachine collider component hit a wall , my character with character controller stop
    colliding with the world and fall from terrain .
     
  17. Alexsandro-Natsume

    Alexsandro-Natsume

    Joined:
    Apr 20, 2015
    Posts:
    22
    im having this problem with nintendo switch only
     
  18. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,623
    Hmmm... there is a known issue with CM 2.1.10 relating to colliders not working properly in some builds. Haven't seen it on Switch before, but there's a good chance that it's your culprit. Here is a patch you can try:

    Find CinemachineCollider.cs, and replace the RespectCameraRadius() method with this:
    Code (CSharp):
    1.         private Vector3 RespectCameraRadius(Vector3 cameraPos)
    2.         {
    3.             Vector3 result = Vector3.zero;
    4.             int numObstacles = Physics.OverlapSphereNonAlloc(
    5.                 cameraPos, m_CameraRadius, mColliderBuffer,
    6.                 m_CollideAgainst, QueryTriggerInteraction.Ignore);
    7.             if (numObstacles > 0)
    8.             {
    9.                 if (mCameraColliderGameObject == null)
    10.                 {
    11.                     mCameraColliderGameObject = new GameObject("CinemachineCollider Collider");
    12.                     mCameraColliderGameObject.hideFlags = HideFlags.HideAndDontSave;
    13.                     mCameraColliderGameObject.transform.position = Vector3.zero;
    14.                     mCameraColliderGameObject.SetActive(true);
    15.                     mCameraCollider = mCameraColliderGameObject.AddComponent<SphereCollider>();
    16.                     var rb = mCameraColliderGameObject.AddComponent<Rigidbody>();
    17.                     rb.detectCollisions = false;
    18.                     rb.isKinematic = true;
    19.                 }
    20.                 mCameraCollider.radius = m_CameraRadius;
    21.                 for (int i = 0; i < numObstacles; ++i)
    22.                 {
    23.                     Collider c = mColliderBuffer[i];
    24.                     if (m_IgnoreTag.Length > 0 && c.CompareTag(m_IgnoreTag))
    25.                         continue;
    26.                     Vector3 dir;
    27.                     float distance;
    28.                     if (Physics.ComputePenetration(
    29.                         mCameraCollider, cameraPos, Quaternion.identity,
    30.                         c, c.transform.position, c.transform.rotation,
    31.                         out dir, out distance))
    32.                     {
    33.                         result += dir * distance;   // naive, but maybe enough
    34.                     }
    35.                 }
    36.             }
    37.             return result;
    38.         }
    Let me know how this works for you.
     
  19. Alexsandro-Natsume

    Alexsandro-Natsume

    Joined:
    Apr 20, 2015
    Posts:
    22
    from a simple test scene looks like the problem its gone , Thank you!.
    can you explain me what was causing this problem?
     
  20. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,623
    The NaN positions were breaking the physics system, but only on some platforms
     
  21. Alexsandro-Natsume

    Alexsandro-Natsume

    Joined:
    Apr 20, 2015
    Posts:
    22
    so if it hit anything the whole system break?
     
  22. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,623
    possibly, yes
     
  23. Alexsandro-Natsume

    Alexsandro-Natsume

    Joined:
    Apr 20, 2015
    Posts:
    22
    lol! i solved my problem , thank you very much!
     
    Gregoryl likes this.
  24. Keepabee

    Keepabee

    Joined:
    Jul 12, 2012
    Posts:
    58
    Hi! Cinemachine 2.2.0 Unity Package Manager release is broken.

    I'm migrating from the last Asset Store version to the Package Manager Cinemachine 2.2.0 and every camera and virtual camera object in every scene of my project now has a "Missing MonoBehaviour".

    I figured out the missing reference was previously CinemachinePostFX, a component that is no longer present in the default setup of Cinemachine as of a few versions back. The documentation and many forum posts advise that you have split that component as part of a separate Adaptor package for integrating Cinemachine with Unity PostProcessing Stack, and have two Adaptors for V1 (Asset Store, legacy) and V2 (Package Manager, previously on GitHub) of the PostProcessing Stack.

    Cinemachine 2.2.0 release on Unity Package Manager is missing the unitypackage for PostProcessing Stack V1 Adaptor, and even the Cinemachine MenuItem in Unity Editor shows only the "Import Post Processing V2 Adaptor Asset Package" option and nothing for V1. The Editor menu missing V1 can be seen in a screenshot by @Gregoryl at a relevant issue post here on the forums ("Cinemachine Post Fx Missing").
     
  25. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,623
    @Meatgrind We are trying to encourage the community to use Post Processing v2 as it's so much better in so many ways, and having the v1 support there in the menu was sending the wrong message. Is there a strong reason why you don't want to move to PPv2?
     
  26. Keepabee

    Keepabee

    Joined:
    Jul 12, 2012
    Posts:
    58
    Just for the time being our artists/designers are busy and cannot be tasked to remove every CinemachinePostFX behaviour and delete and recreate all post processing profiles. If I were to upgrade to Cinemachine 2.2.0 now as it is, I would just leave EVERY Scene in our game broken visually and full of missing components and I assume there would be little to no way to reference what things were supposed to look like when recreating the postprocessing in PostProcessing Stack V2 later.

    So, while we will eventually move to PPV2, we cannot at the time, and since PPV1 Adaptor is not available at all, we cannot upgrade Cinemachine either - which would have been a nice cleanup task and modernisation for yesterday otherwise.

    @Gregoryl could you simply add the .unitypackage for PPV1 Adaptor into the Package Manager fileset, alongside the PPV2Adaptor.unitypackage? You could keep the menuitem hidden if you wish to hide the option from most users, but PPV1 Adaptor would still be available in the AppData/Local PackageManager cache for those who really need this.

    EDIT: I got my reply in another thread (Cinemachine Post Fx missing) - sorry if my hurried double-posting causes confusion.
     
    Last edited: Jun 25, 2018
  27. Adam_Myhill

    Adam_Myhill

    Joined:
    Dec 22, 2016
    Posts:
    342
    The look and performance improvements in PPSv2 are seriously worth considering. How many cameras/PPS profiles do you have? I bet you could rebuild them all in a few hours. You'll thank yourself for doing so!
     
  28. sd1515

    sd1515

    Joined:
    Jan 20, 2018
    Posts:
    10
    I've been checking the documentation, and have downloaded the Cinemachine package, and Post Processing v2, and I'm using Unity version 2018.1.8f1. When I try to access any part of Cinemachine (like "CinemachineFreeLook freeLookCam"), I am getting errors. I use MonoDevelop. BUT when I switch to Visual Studio, no such problems, I can access it easily.

    Not sure if this is a frequent problem that has a workaround, but I figured someone else might be running into this too.
     
  29. Jeigh07

    Jeigh07

    Joined:
    Sep 30, 2016
    Posts:
    1
    Thanks for the info. I was stuck with this problem for like 4 hrs. I switched to VS
     
    sd1515 likes this.
  30. Gerold_Meisinger

    Gerold_Meisinger

    Joined:
    Sep 8, 2015
    Posts:
    93
    We are using Cinemachine only for a 2D project. I tried disabling the Physics module in the package manager but then get the error:
    CinemachineCollider
    error CS1070:
    The type `UnityEngine.RaycastHit' has been forwarded to an assembly that is not referenced. Enable the built in package 'Physics' in the Package Manager window to fix this error.

    How can I use Cinemachine without requiring a lot of unused modules?
     
  31. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,623
    Out of the box, module disabling is not yet supported. If you really want to do this, you'll have to embed Cinemachine into your assets, and customize it by ifdef'ing out the code that's complaining.
     
  32. kokoki2

    kokoki2

    Joined:
    Oct 29, 2018
    Posts:
    2
    • in the new package manager, FetLife IMVU Canva the Cinemachine 2.1.10 install was not detected, So and I had to make a new install and then the console was spawning error everywhere as two Cinemachine were in the project.
     
    Last edited: Nov 3, 2018
  33. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,623
    @kokoki2 Yes if you want to switch between package manager and embedded versions of CM, you have to first delete the old one, then install the new one or you will get such problems
     
  34. kischenko_c2p

    kischenko_c2p

    Joined:
    Oct 28, 2016
    Posts:
    1
    Hey guys. How can I delete dependencies on Physics, Video and Director libraries in your plugin? Are there any scripting #define derectives to remove them? I am developing 2D game for WebGL, and those libraries, especially Physics, weights a lot, and I don't need them in my build at all (it increases time of downloading content and compiling scripts). I had the same issue with TextMeshPro, and they fixed it. Thanks
     
  35. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,623
    At present there are no such defines, but we will add them. In the meantime, you can certainly delete (or ifdef out) the files that are getting in your way. CM is quite modular, and generally won't suffer from the removal of some of its parts.
     
  36. starlove54

    starlove54

    Joined:
    Oct 1, 2016
    Posts:
    1
    Not having the cinemamachine option via packet manager, what should i do?
     
  37. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,623
    Can you post an image of your package manager window?
     
  38. asd350835

    asd350835

    Joined:
    Feb 12, 2021
    Posts:
    1
    how can I use InputSystem unity 2018