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

Cinemachine v1.1

Discussion in 'Cinemachine' started by Adam_Myhill, Jan 5, 2017.

  1. wholtaeter

    wholtaeter

    Joined:
    Mar 30, 2016
    Posts:
    15
    For the first step it would just be fine showing the overlay texure. - 2nd step, yes would be great if it would track the focus point and show the frame dynamicly around it. - Is it a feature for the next version?
     
  2. Adam_Myhill

    Adam_Myhill

    Joined:
    Dec 22, 2016
    Posts:
    342
    @pixelsteam we recommend using CM v2 with 2017.1. Copy your project and do a test move to 2017.1b2 just for giggles and see how it goes. The days of upgrades being super painful are hopefully behind us. I've upgraded a number of project just fine (minus the 2017.1b3 issue mentioned on the CM v1.5 thread. Are you using Timeline? Let me know how it goes.

    @AFrisby Your project looks really cool, what a concept! What to say... CM v2.0 is a much more open layout. We won't break backwards compatibility again, fingers effing crossed. You'll need to remake your cameras - and trust me I feel you, I'm having to remake the cams for all my demos too - but this is a bandaid we need to rip off to get all this behind us.

    Unless you've built literally dozens of cameras, go CM v2.0, get all the goodies and be part of the new architecture.

    Are you moving your project to 2017.1 ?
     
    AFrisby and Alverik like this.
  3. timmehhhhhhh

    timmehhhhhhh

    Joined:
    Sep 10, 2013
    Posts:
    157
    This asset is power packed but this is where I'm currently struggling to figure out how to make it do what I like; we had a similar experience with ProCamera2D, where it's a wonderful asset but also tricky to make it do exactly what we wanted, so at the end of the day it was easier to roll our own thing. So, a few questions:

    1. I understand it's difficult to create tutorials covering every use case, but will we see additional tutorials included in the future?

    2. One common setup we have is an overhead camera. A player might tap on an object in the scene, and you should get a nice camera swoop where the selected object stays in focus for the duration. When you return to the overhead view, the selected object should remain composed in the shot as the camera swoops back to the original overhead position AND orientation. This is something that is fine to define as static animations but as a project scales, it would be nice to have a more procedural setup that "just works", using either some smart tweening or something like Cinemachine. Am trying a few different approaches with Cinemachine (and am only just getting started) but am struggling to find something that works well and consistently in this case. Custom blend routine where I'm locking certain axis? Animating faux points of interest? Basically, a dynamic way to say "I want you to go from this predefined shot (position and orientation) to another predefined shot (position and orientation), while keeping a number of prioritized things in view, and I don't really care how you get there". Is Cinemachine well suited for this kind of thing?

    3. It seems like v2 is coming soon and won't be backward compatible? Is it best to wait for that? Also, will it be 5.6 compatible (most of our current projects will be locked to 5.6).

    Cheers!
     
    Last edited: May 5, 2017
  4. Adam_Myhill

    Adam_Myhill

    Joined:
    Dec 22, 2016
    Posts:
    342
    @tbriley - tutorials and example scenes. Yes. We have big plans for this so people can quickly and easily see what CM can do in all its configurations.

    Your #2 example sounds possible by blending between two Composer shots. If you set each camera to target your desired object with a Composer component on the Aim setting for each composer camera, then any positional blends between the two will maintain your desired composition.

    If you're switching targets then the blends will be a smooth lerp shortest distance between the two because that's the most useful thing. If you need something specific then you can configure things to suit your desired behavior: Blend to a set 'middle point' camera, or have the camera target a dummy object which you animate exactly how you want during those blends and 'marionette' Cinemachine.

    As for tracking a number of options, this comes up all the time. It's a scenario that has so many different desired behaviors that we've never move forward on anything because it wouldn't be versatile enough. That said, it works really well to drive a target object and have CM track that. You won't need to drive the target object very smoothly because you can use the CM damping to smooth it out. This way you can have your target object do exactly what you want RE multiple objects, etc. etc. and then lean on CM for all the blending, smoothness and compositional controls.

    3. v2 will not be backwards compatible due to opening the API. It's much more open, has many more features and will be the foundation for all things to come. We recommend using it over v1.x for numerous reasons. We suggest using it with 2017.1 because that's what it's meant for and it will look for Timeline but you can make it work with v5.6 if you need to.
     
    Alverik likes this.
  5. bac9-flcl

    bac9-flcl

    Joined:
    Dec 5, 2012
    Posts:
    829
    Hi, @Adam_Myhill! We're currently using Cinemachine in our project and loving it to bits, especially after fixes for unscaled time case and collisions. :) One thing I somewhat missed, though, is this - how can I control the speed of a transition between two virtual cameras when one is disabled and another is enabled? I might be overlooking some obvious parameter, but I don't see any transition time related fields anywhere.
     
  6. Adam_Myhill

    Adam_Myhill

    Joined:
    Dec 22, 2016
    Posts:
    342
    @bac9-flcl Easy, either set the global default transition to be something other than 2 seconds, or make a custom blend asset and then set specific blends to and from your cameras.

    Under AUTOGEN_CinemachineRuntime there are the Blend Settings to do exactly what you are looking for.
     
  7. bac9-flcl

    bac9-flcl

    Joined:
    Dec 5, 2012
    Posts:
    829
    Thanks, that works great! :)
     
  8. xtyler

    xtyler

    Joined:
    Dec 8, 2012
    Posts:
    12
    Hi Adam,

    You mentioned working with side scrolling; can Composer be set to transform and not rotate? Transposer by itself doesn't have the wide variety of options Composer does.

    thanks!
     
  9. Adam_Myhill

    Adam_Myhill

    Joined:
    Dec 22, 2016
    Posts:
    342
    Hi @xtyler

    Side scrolling can be done a number of ways. Transposer just moves the camera body, only translations so it won't add rotations at all. Composer only does camera rotations. They're decoupled for a number of reasons.

    You can think that the Transposer is like a camera tripod, or dolly or any other camera movement rig. The Composer is like a fluid head, which pans and tilts to track the action. Separating them lets you put any head on any rig, just like on a movie set.

    Your question - to translate a camera without rotation - don't put a target on the Composer. You can then set the directin and leave it.

    Note - Cinemachine 2.0 is in release candidate to get some last testing before a full release with Unity 2017.1. It has come a long way. You might want to give it a try if it's possible for you to upgrade your project to 2017.1 as it has so many new cool features - including a dolly track Transposer which is great for sidescrollers.

    Let me know how it goes either way
     
    xtyler and Alverik like this.
  10. xtyler

    xtyler

    Joined:
    Dec 8, 2012
    Posts:
    12
    Thank you for your quick reply! This works great for realistic cameras in a 3D world, but for 2D animation I need to simulate the richness of the real world through animation tricks, parallax and camera movement. Playdead's Limbo is a great example.

    I've started using Timeline and Cinemachine 2.0 and it's looking great! However, to get a handheld camera feel in 2D I'll be using my own system for now. It's worth considering the option of using Cinemachine's calculated Composition target for translation instead of orientation for 2D. I'll let you know how it goes.

    Additional resource for 2D cameras
     
    Alverik likes this.
  11. Adam_Myhill

    Adam_Myhill

    Joined:
    Dec 22, 2016
    Posts:
    342
    Thanks @xtyler great link
    Cinemachine was originally designed for 3D but we know of a lot of people using it for 2D and there are some specific 2D feature requests. We are working on them next milestone so don't hesitate to describe exactly what you'd like so we can incorporate it
     
    Alverik likes this.
  12. xtyler

    xtyler

    Joined:
    Dec 8, 2012
    Posts:
    12
    Essentially I'm looking for a Transposer option with the same features as Composer: a screen area dead-zone, soft-zone, offsets etc. The effect is to mimic Composer when rotation is not available.

    I did had fun experimenting with a LateUpdate script that re-calculated Position from Composer's camera rotation and then reset rotation to identity. It was pretty trippy, fluctuating back and forth inside the deadzone. Probably not the best way to solve the problem.
     
  13. AFrisby

    AFrisby

    Joined:
    Apr 14, 2010
    Posts:
    223
    Quick q. is CM 2.0 being packported to 5.6; or it will it absolutely require 2017.1?
     
  14. JakubSmaga

    JakubSmaga

    Joined:
    Aug 5, 2015
    Posts:
    417
    It uses the newest API so probably 2017.1.
     
  15. Skyfly

    Skyfly

    Joined:
    Jan 25, 2014
    Posts:
    110
    1.1. won't move the camera. I can see the red frame of the CM traking moving with the composer targte, but the actual camera won't move. unity 5.5.0p3 here. Tried the example scene aswell. No error, only some info get loggeed:

    A CinemachineRuntime was automatically generated for this scene. Click to view. This object must exist in your scene for Cinemachine to function
    UnityEngine.Debug:Log(Object, Object)
    Cinemachine.Utility.CinemachineDebugLogger:LogWarn(Object, String) (at C:/GML/cinemachine/cinemachine-1.1.2/source/Cinemachine/Utility/CinemachineDebugLogger.cs:58)
    Cinemachine.CinemachineRuntime:get_Instance() (at C:/GML/cinemachine/cinemachine-1.1.2/source/Cinemachine/Scripts/CinemachineRuntime.cs:161)
    Cinemachine.CinemachineCoreAccess:get_CoreInstance() (at C:/GML/cinemachine/cinemachine-1.1.2/source/Cinemachine/Scripts/CinemachineRuntime.cs:23)
    Cinemachine.CinemachineVirtualCamera:OnEnable() (at C:/GML/cinemachine/cinemachine-1.1.2/source/Cinemachine/Scripts/CinemachineVirtualCamera.cs:211)
    UnityEngine.GameObject:AddComponent()
    Cinemachine.Editor.CinemachineMenu:CreateDefaultCameraRig() (at C:/GML/cinemachine/cinemachine-1.1.2/source/Cinemachine.Editor/Menus/CinemachineMenu.cs:39)
     
  16. Adam_Myhill

    Adam_Myhill

    Joined:
    Dec 22, 2016
    Posts:
    342
    @Skyfly
    Open a clean project
    Import the CM package, import everything
    Create a virtual camera
    Set the composer to track an object
    Move the object

    What happens?
     
  17. Danirey

    Danirey

    Joined:
    Apr 3, 2013
    Posts:
    548
    Hi there,

    I'm playing with cinemachine, and it is awesome! Very cool!! :)

    Now, i have in my scene two static cameras pointing almos oppsite one of the other. When blending, it goes a bit crazy with which direction to choose. It ends somtimes in a smooth transition, but the most of the time it freaks out blending. Are there any way to set a direction or to avoid that in any way?

    Thanks a lot!
     
  18. Adam_Myhill

    Adam_Myhill

    Joined:
    Dec 22, 2016
    Posts:
    342
    @Danirey Doing a straight blend of almost 180* is not a great way to get a nice camera path.

    We've drastically improved that with CM v1.5 and v2.0. See if you can move up to those.

    If you're on Unity 5.6x then you'll want CM v1.5: https://forum.unity3d.com/threads/new-cinemachine-v1-5.459352/

    Remember, you MUST turn off the postfx and Timeline assets when importing the CM package if you don't have them in your project. We fixed that with v2.0 but v1.5 needs to not import those assets if you don't have them otherwise you'll get errors.

    If you can move up to 2017.1x, then jump into CM v2.0 and get all the latest stuff, including improvements in this area.

    That said! Doing huge blends across 180* is never a good idea, both technically and perhaps cinematically. Try an interim camera to blend to or use the Orbital Transposer in CM 1.5+ and animate the world heading angle to get a nice orbit.
     
    Danirey and Alverik like this.
  19. Skyfly

    Skyfly

    Joined:
    Jan 25, 2014
    Posts:
    110
    I have CM 2 running with postfix in 5.6.1f1. All features are working, is there anything else that should cause issues with cm2 and 5.6x? Performance?
     
  20. Adam_Myhill

    Adam_Myhill

    Joined:
    Dec 22, 2016
    Posts:
    342
    Performance should be just fine. CM is super light. There are only 2 systems which have any real cost and they are the Collider and Dolly/Path.

    We've made them configurable so you can make them as efficient as possible - reduce the radius of the Dolly auto follow calculations, and to turn off the Collider Line of Site and Curb Feeler systems. They do raycasts which aren't free.
     
    Skyfly and Alverik like this.
  21. Danirey

    Danirey

    Joined:
    Apr 3, 2013
    Posts:
    548
    Thanks a lot for all the info. I have now another one in the midlle and it works fantastic. Thanks a lot!
     
  22. RKTeam

    RKTeam

    Joined:
    Nov 29, 2016
    Posts:
    6
    Is it real use cinemachine for a few cameras at the same time?
     
  23. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,623
    Unless you have something like a split-screen scenario, there will normally be only one active Game Camera at a time. In this case, CM allows you to control the active cam in sophisticated ways by creating multiple virtual cameras. Think of virtual cameras as camera operators that can pass the main camera around and control it.

    If you have something like a split-screen with multiple active cameras, then CM can still be used to control them independently of each other, by associating specific virtual cameras with active camera instances.

    EDIT: note that for split-screen you will need CM 2.0
     
    Alverik likes this.
  24. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Hi guys, I started to play around with CM and Im really starting to liking it.. :D

    I have a doubt regarding the FreeLook Rig.. how can Invert the Axis? ( Y or X mouse look)
     
  25. JakubSmaga

    JakubSmaga

    Joined:
    Aug 5, 2015
    Posts:
    417
    1. Go to Edit -> Project Settings -> Input.
    2. Open Axes.
    3. Enable "Invert" inside "Mouse X" and "Mouse Y"
     
    Malbers likes this.
  26. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Thanks ! now is perfect for my games!!!
     
  27. iamarugin

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    880
    Is there any way to not save some changes to vcam settings during play mode? For example I want to changeTransposer offset when some event happend, but I dont want these changes to ba saved.
     
  28. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,623
    Yes, you can add the [NoSaveDuringPlay] attribute to any fields that you want not to be auto-saved. Alternatively, you can just turn off SaveDuringPlay altogether. See SaveDuringPlay.cs and comment out a couple of lines.
     
    Last edited: Jul 19, 2017
    iamarugin likes this.
  29. iamarugin

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    880
    Thank you.
     
  30. IgorAherne

    IgorAherne

    Joined:
    May 15, 2013
    Posts:
    393
    Hey guys, is there a way to put two virtual cameras, then manually specify a zero-to-one lerp weight from code? This would glide me between the two cameras, but would allow me to remain in between of them, as long as I keep lerp value at 0.5

    I can't see it in CinemachineBrain.cs

    Thanks!
     
  31. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,623
    In fact there is an internal API used by Timeline to do exactly this. Because it's internal, we do not specifically support it, but I suppose you could use it in a pinch. Check out CinemachineBrain.SetCameraOverride(). Use at your own risk.
     
    Malbers and IgorAherne like this.
  32. deadlycrow

    deadlycrow

    Joined:
    Feb 10, 2014
    Posts:
    166
    Is there any way to invert the mouse Y axis in the orbital free look camera? but just in that camera??
     
  33. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,623
  34. deadlycrow

    deadlycrow

    Joined:
    Feb 10, 2014
    Posts:
    166
    Thanks! i already figured it out yesterday late in the night hahaha... now i'll update so i can avoid using a custom axis :)
     
  35. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,623
    @IgorAherne FYI Cinemachine 2.1 has a class conceived especially for this sort of thing. It's called CinemachineMixer, and it allows you to maintain up to 8 vcams in a continuous blend whose weighting you control. Much better to use that than an unsupported, undocumented, internal API :)
     
  36. deadlycrow

    deadlycrow

    Joined:
    Feb 10, 2014
    Posts:
    166
    @Gregoryl i have a first person camera system mounted with cinemachine, it is a state driven camera, with a few virtual cameras (idle, walk, run, etc..) and i have noise applied to all of them, but some times when i switch between them a little fast they get bumpy, but it occurs more often when the change is drastic like from the "sprinting" camera to the "idle" one, so my question is: is there any glitch or something weird going on between the "noise lerping" process? or is there any lerping between the noises of the cameras ? or maybe i'm just forgetting something haha
     
  37. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,623
    @deadlycrow I'm not aware of any issues in this department. Can you send me a video - or a stripped down project - showing the effect?
     
  38. Carrmichaelll

    Carrmichaelll

    Joined:
    Nov 30, 2016
    Posts:
    68
    hi does anybody get a jerky movement when they use the orbital transposer with cinemachine??
     
  39. Carrmichaelll

    Carrmichaelll

    Joined:
    Nov 30, 2016
    Posts:
    68
    hi, i'm using unity 2017.2 beta, and i'm getting a jerky movement with cinemachine whenever i use orbital transposer, i've tried setting the update mode to everything available but it still doesnt provide any good result, when i use a rigidbody and move by using veloctity, it works fine, but when i use animation rootmotion it begins to vibrate weirdly
     
    Last edited: Sep 21, 2017
  40. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,623
  41. Carrmichaelll

    Carrmichaelll

    Joined:
    Nov 30, 2016
    Posts:
    68
    hi i'm using the latest version of cinemachine (version 2.01), i just tested a different project and its still jittery, so far this only happens when i choose the freelook camera or the orital transposer body rig
     
  42. Adam_Myhill

    Adam_Myhill

    Joined:
    Dec 22, 2016
    Posts:
    342
    2.01 isn't the latest one. Did you get it from the Asset Store?

    The latest versions are always kept in a folder which is linked from this post:
    https://forum.unity.com/threads/cm-...tures-new-fixes-improvements-examples.491278/

    Give that one a try and let us know. Note - a brand new version will be released shortly which may even further improve things but definitely get the one from the google folder and not the Asset Store to test this.
     
  43. Carrmichaelll

    Carrmichaelll

    Joined:
    Nov 30, 2016
    Posts:
    68
    ooh wow yes thank you very much!, i got it from the asset store, i'm going to give this a go and reach back to you guys
     
  44. Carrmichaelll

    Carrmichaelll

    Joined:
    Nov 30, 2016
    Posts:
    68
    unfortunately it's still Jerky, here is the freelook camera with its default values still intact

     
  45. Adam_Myhill

    Adam_Myhill

    Joined:
    Dec 22, 2016
    Posts:
    342
    Was the video taken down? Can't see it
     
  46. Carrmichaelll

    Carrmichaelll

    Joined:
    Nov 30, 2016
    Posts:
    68
    ooh, it was private sorry, please look at it again
     
  47. JakubSmaga

    JakubSmaga

    Joined:
    Aug 5, 2015
    Posts:
    417
    How many FPS do you have?
    Have you tried switching CM update mode?
     
  48. Carrmichaelll

    Carrmichaelll

    Joined:
    Nov 30, 2016
    Posts:
    68
    at least 90FPS, i've tried the late update, it improves it but still jerks a little, does this happen to only me?, i remember the old cinemachine didn't have this problem but i think its a compatibilty issue with unity, because when i was running on an older unity version i didnt face this issue
     
  49. JakubSmaga

    JakubSmaga

    Joined:
    Aug 5, 2015
    Posts:
    417
    Could you try to make a repo project and send it to @Gregoryl or @Adam_Myhill ?
     
  50. Carrmichaelll

    Carrmichaelll

    Joined:
    Nov 30, 2016
    Posts:
    68
    sure!, do i put it on google drive or there's another way its done over here