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

It's out ! Cinemachine v2 is on the Asset Store

Discussion in 'Cinemachine' started by Adam_Myhill, Jul 11, 2017.

  1. Adam_Myhill

    Adam_Myhill

    Joined:
    Dec 22, 2016
    Posts:
    342
    Camera wizards! Cinemachine v2 is out on the Asset Store and has a pile of new features - documentation! - and numerous fixes and improvements.

    Get Cinemachine
    Requires Unity 2017.1.0 or higher.

    upload_2017-7-11_14-12-15.png
    - Target multiple objects: CinemachineTargetGroup. This allows you to target multiple objects and set the weighting between them. It creates a logical group based on any number of subjects that positions itself according to the position of its members. It can be used as a LookAt and Follow target when tracking a group of objects. Great for 2D as well.

    - Dynamically frame multiple objects: CinemachineGroupComposer vcam Aim component. This will dynamically auto-frame a group of targets based on their postitions. If the objects move apart, Cinemachien will adjust the FOV or dolly (or both) depending on a set of rules you create. When the LookAt target is a CinemachineTargetGroup, this composer will ensure that the entire group gets framed correctly. Uses a configurable combination of zoom and dolly in/out.

    - Added support for orthographic cameras. If the brain is on an orthographic camera, Cinemachine will function correctly. 2D support.

    - New Completely open API. Code against any Cinemachine aspect. Easily custom configure Cinemachine to get exactly the camera behaviour your project needs

    - Dolly track. Create film-like dolly track and have your camera smoothly move through your worlds. Keyframe the camera down the path or have Cinemachine auto-follow the subject. Ideal for cinematic sequences or game cameras where you want the camera to follow the subject down a set of rails. forTrackedDolly: Options for up vector: match path or follow target. If no lookAt target, camera will orient itself according to this setting, allowing you to create a rigid rig on a track.

    - Collider. Improvements to the collision system. Added automatic Line of Site distance, and Minimum Obstacle Distance From Target parameter. No need to manually set the Collider look-at distance

    - ClearShot. Cinemachine ClearShot will dynamically choose the best camera based on shot priority and how good the shot is. Did something move into frame wrecking the shot? No problem, Cinemachine will cut to the next best camera. Incredible for replays or any other cinematic sequence of a variable scenario. Randomization features allow for variability of cutscenes for boss or game intros - create a few cameras and have Cinemachine randomize them and always pick the best shot

    - Shote Evaluation. Improvements to Cinemachine's shot evaluation and auto-editing capabilities: boost quality for shots that are closer to optimal distance. Optimal distance setting allows for better shot evaluation based on your desired shot target distance

    - Follow camera improvements: Orbital Transposer: Improvements and additional controls for heading bias, follow based on position delta, vector, world heading. Multiple blend modes, per-axis damping controls. Easily create sophisticated follow cameras.

    - FollowZoom: Cinemachine will automatically adjust FOV based on subject distance to keep objects the same size on screen. You can control object size between cuts even when distances change. Incredibly powerful when used with ClearShot to do dynamic cutscenes - head sizes will match even if characters move around.

    - Added damping to FollowZoom. Allows camera to slowly zoom in/out to track target. Feels very sports broadcast.

    - CinemachineSmoother: Module adds damping to any camera rig for an extra level of smoothness. Added LookAt filter

    - Improved FreeLook spine shape. It's easier to make a perfectly smooth spherical / rounded shape for Cinemachine Free-Look, an incredibly powerful 3rd person action adventure camera

    - State Driven Camera. This allows for code-free linking of cameras and animation states. Easily trigger different camera behaviors from animations. Configure 'Roadie run' handheld cameras when the character sprints - within seconds. Effortlessly adjust any camera parameter from any animation state with full in-out blending control. Very powerful in state-machine setups.

    - Cinemachine supports SaveDuringPlay! SaveDuringPlay refactor: now it's opt-in based on a class attribute. Multiple instances of a behavior on a single game object will not be confounded.

    - Bug fixes:
    - bugfix: target marker in composer guide was sometimes drawn in the wrong place (if target was a bone and nontrivial scaling was involved)
    - bugfix: vcams invalidate previous state when targets are changed
    - bugfix: Camera blends now always take the same amount of time, regardless of framerate
    - bugfix: Collider will report lower quality while its influence is decaying because of smoothing
    - bugfix: vcam tansfrom always reflects camera state, even if no targets

    - AddComponent menu name changes: "Cinemachine" appears where it should.
    - Added Create Dolly menu item. Creates a Dolly vcam with an empty dolly track.
    - Added Create Target Group Camera menu item. Creates an empty TargetGroup and a camera that targets it with th GroupComposer.
    - CinemachineCore exposes a delegate to override the default System.Input.GetAxis() to make it easier to use custom input systems with the FreeLook and OrbitalTransposer.
    - OrbitalTransposer exposes axis input value property in addition to axis value property for even more input control. Drive it any way you like.
    - CinemachineBrain: added checkbox to show/hide white camera frustum.
    - Removed CinemachineDebugLogger, which was not compatible with Windows builds


    We love your feedback
    Don't hesitate to reach out with any questions, issues or feature ideas.

    Our goal is to give you the most powerful tools available
    so you can create amazing experiences.





     

    Attached Files:

  2. Dakalo777

    Dakalo777

    Joined:
    Nov 2, 2016
    Posts:
    4
    Hi! quick question, can i use cinemachine in mobile VR like google cardboard?
     
  3. Adam_Myhill

    Adam_Myhill

    Joined:
    Dec 22, 2016
    Posts:
    342
    I get that question all the time @Dakalo777 At its heart, Cinemachine is really just an animation system. It just happens to be an animation system which likes working with cameras.

    In VR, your head is the camera and your body is the animation system. When you take control away from the viewer in VR it can get pretty jarring and even pukey. That said, we are working on some ideas for CM+VR - using the smoothness of our buttery math to move your position, based on user input.

    A really exciting use of CM in VR is the ability to procedurally shoot a VR scene and display that for any non-vr spectators, or to create videos of the VR enviro for marketing, etc. etc.

    You can see some of that here:
     
    andrew-lukasik and Alverik like this.
  4. MaxAuer

    MaxAuer

    Joined:
    Jul 14, 2017
    Posts:
    3
    Hey Adam! Nice work on Cinemachine. Saw it at the Unite Keynote and now had time to get my hands on it.
    It is realy nice and I love the extensebility. Kudos for that.

    One thing I wanted to ask before I try to implement it myself: Is there a Camera that follows an object but does nothing while inside the dead zone? Basicly I want to have a camera that watches an object and moves with/recenters when the object moves to the edges of the dead zone.

    Example from Mario:


    Tried it with the FreeLook Camera but even though the dead zones are set up correctly it always centers the target.
     
  5. Alverik

    Alverik

    Joined:
    Apr 15, 2016
    Posts:
    417
    Wow, hope we see some of the VR features sometime soon :). Smoothing out the VR camera slightly sounds really interesting, since it might actually help some people with nausea issues. Right now VR doesn't have much stabilization (unlike our eyes), so it's quite easy to get motion sickness...
     
  6. hensoup

    hensoup

    Joined:
    Jan 13, 2014
    Posts:
    35
    Assets/Cinemachine/Base/Runtime/Components/CinemachineComposer.cs(172,59): error CS0118: `Cinemachine.CinemachineComposer.OnGUICallback' is a `field' but a `method group' was expected

    and using the latest and also reinstalled 2017 I keep getting taht error
     
  7. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,623
    I don't get any errors with 2017.1 when I create a project and add Cinemachine to it. Can you give more details about what you're doing, and about your setup?
     
  8. hensoup

    hensoup

    Joined:
    Jan 13, 2014
    Posts:
    35
    I tried the new project and that works. but I am working on a already existing project and added cine-machine straight from the asset store into it . it gives me the error. my current project I will try to transfer scripts and assets over to the working Cinemachine file
     
  9. hensoup

    hensoup

    Joined:
    Jan 13, 2014
    Posts:
    35
    FIXED it just don't call any script "action" and it worked. I renamed the script "action1" and it fixed it
     
  10. Carrmichaelll

    Carrmichaelll

    Joined:
    Nov 30, 2016
    Posts:
    68
    Hi, i'm trying to use cinemachine for a third person shooter, and i'm having issues with aiming my cross hair as the camera seems to rotate in a weird way, i've tried the free look camera but all the individual rigs causes weird rotations, so i'm basicaly stuck with the virtual camera and i'm using the ("orbital transposer") for the body, but i can't roate in the Y axis,

    i would love to know why there's only the x axis option for rotation.
    and what your advise would be for my situation.
    thanks!
     
  11. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,623
    You're going to have to give some more details about your setup.
    Maybe you can tell me what happens when you do this:
    Cinemachine>Create FreeLook Camera
    Drag your character's root transform onto the new FreeLook's LookAt and Follow target fields.
    Run the game. You should get orbiting along both axes when you use the mouse.
     
  12. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,623
    Just FYI, the new CM version (still unreleased, but coming soon) has a camera that does exactly what you want. Stay tuned!
     
  13. Carrmichaelll

    Carrmichaelll

    Joined:
    Nov 30, 2016
    Posts:
    68
    hi, thank you for the reply and i apologise for my vague description, i was referring to the virtual camera when i asked about orbiting along both axis, it only provides the option to orbit along the x axis.
    secondly when it came to using the free look camera, my rotations were deeply affected by the radius of each rig, because the camera orbited along the radius, so i can't use my character's root as the look at, because my targets are the enemies in the scene, i'm trying to get a "screen look" at my targets which will be controlled by the mouse, so when i push the fire button i will raycast from my screen to the target
     

    Attached Files:

  14. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,623
    @Carrmichaelll I'm sorry but I'm having trouble understanding what you're trying to do. Before talking about the "how", let's get the "what" perfectly clear.

    Here is what I understand so far:
    1. Your player character is walking around, shooting enemies
    2. The camera should follow the player, at some distance behind, with the player a little off-center on the screen, as in a 3rd-person shooter
    3. The camera looks over the shoulder of the player, at the enemy,
    4. The camera displays a graphic over the spot in the world where the player is aiming. In that sense, the camera is acting as a 1st-person shooter camera.

    Some questions:
    1. Is the camera always behind the player?
    2. What if the player turns? What is the camera expected to do?
    3. What do you want to orbit around? i.e the camera moves around what point, and looks at what point?
    4. How do you want the player to control what the camera looks at?
    5. How do you want the player to control where the camera is positioned?
     
    Adam_Myhill likes this.
  15. Carrmichaelll

    Carrmichaelll

    Joined:
    Nov 30, 2016
    Posts:
    68
    hi thanks for the reply
    yes you are absolutely correct with your description of my set up.
    to your questions

    1. yes the camera is always behind the player

    2. when the player turns, the camera works perfectly when i'm moving without the gun because i just recenter the camera to face forward, but when the gun is in hand, i would love the player to have full control of the camera rotation, right now, working with just the x axis is absolutely perfect, with the virtual camera but there's no option for the y axis as seen in the image below.

    3. i think orbiting is fine as im orbiting around the player, but i'd prefer one rig, which is why i'm using the virtual camera instead of the freelook.

    4. i want the player to control what the camera looks at by moving the right joystick or the mouse, in the previous image i sent, the camera will be responsible for rotating to where my enemies are, with the control of the user

    5. the camera positions are perfectly okay as i;m using a state driven camera that works when i'm in different states like unarmed and armed

    in a nutshell i would love to just rotate around both axis in one position, the free look moves the camera up and down, the virtual camera offers what i want but only rotates in the x axis, check the image below,
    i was asking why we dont have the option of rotating with the y axis aswell
    thank you so much for your time
     

    Attached Files:

  16. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,623
    In Cinemachine we decouple the concepts of camera position and camera aim.

    The Transposer has the job of positioning the camera in relation to the Follow target. It controls the location of the camera. Not what the camera looks at. The Orbital transposer add to this the possibility of allowing the camera to orbit around the follow target, on a big circle. That's why there's only one axis, because there is only one degree of freedom. If you want to orbit with 2 degrees of freedom, then by default you'll get a big sphere around the target. The FreeLook gives you this.

    An important point: the Transposer, OrbitalTransposer, and FreeLook positioning do not control what the camera looks at - only where it is positioned in space. Of course by changing the position, what the camera sees will change due to parallax, and it sounds like that horizontal repositioning is approximating the effect you're looking for in the X axis.

    So it seems that you're really looking for a POV camera, positioned behind the player. You want it to be able to rotate its head side-to-side, and up-and-down. You've faked the side-to-side with the orbital (it's actually strafing side-to-side, not rotating). You want to add to this up-and-down movement, but you don't want the camera's height to change too much. Is that right?

    There are several ways to do this. Here are some ideas.

    1. You can have your vcam follow the player (as you are doing), but LookAt a different target, one whose position is controlled by the right joystick. One way to do this is to have an invisible GameObject placed among your enemies, and you control its position with the joystick. Set the vcam's LookAt target to that. Then, regardless of where the camera is positioned in space, it will always look at that target, whose position the player is controlling.

    2. On the other hand, if you like what your original parallax-based approach is giving you for the X axis, and want to extend it to the Y axis, then you can do this with the FreeLook: just configure the 3 orbits to be the same radius, and adjust their heights to be something you like - not too high, not too low. Then, the camera will move in an orbit around the target, with the height controlled by the Y axis.

    3. There is a third possibility. You can configure the FreeLook to be a true POV camera, with the X and Y axes of the joystick controlling the rotation. You do it like this: define a really small sphere around the target by giving the 3 orbits very small negative radii and very close together in height (make a ball something like 20cm in diameter). Set the LookAt and Follow targets to the same thing: an invisible game object placed behind your character. Now the camera will behave as the head of an invisible cameraman following your character.
     
  17. Carrmichaelll

    Carrmichaelll

    Joined:
    Nov 30, 2016
    Posts:
    68
    thank you very much! i'm going to start working on your method
     
  18. Carrmichaelll

    Carrmichaelll

    Joined:
    Nov 30, 2016
    Posts:
    68
    hi, it worked perfectly thank you very much.
     
  19. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,623
    Which method did you use?
     
  20. jtp1987

    jtp1987

    Joined:
    Dec 18, 2016
    Posts:
    2
    I also have a question too. Can I use the FreeLook and Collider component together? Because when I try that I get an error message.

    UnityCinemachine.png
     
  21. JakubSmaga

    JakubSmaga

    Joined:
    Aug 5, 2015
    Posts:
    417
    Yup, Collider works with FreeLook. Does your Collider works even when you get the errors? (in the game mode)
     
  22. jtp1987

    jtp1987

    Joined:
    Dec 18, 2016
    Posts:
    2
    Yes it works
     
  23. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,623
    Yes, the error messages are a known issue, fixed in CM 2.1, on the asset store soon.
     
  24. Carrmichaelll

    Carrmichaelll

    Joined:
    Nov 30, 2016
    Posts:
    68
    i used the second option you gave :)