Search Unity

Soooo... how to get started?

Discussion in 'Cinemachine' started by AaronC, Mar 11, 2017.

  1. AaronC

    AaronC

    Joined:
    Mar 6, 2006
    Posts:
    3,552
    Great work on this, I'm excited to get into this, and I've watched the GDC presentations and read over the cinemachineimagery website, but I can't seem to find anything that says

    Step one: Add xxx
    Step 2: Add yyyy to zzz...

    And so on. Whats actually added to what, and is there some super basics rather than looking at examples and trying to reverse engineer them before trying to guess how they were built?

    There must be something profoundly useful I have missed.
    Thanks
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,728
    Well, this is very new and we're a little lean on the docs at the moment. Bear with us :)
    We've focused on making this easy for a non-programmer, and consequently the script API has a little catching up to do.

    So, from the editor:

    Step 1: From the main menu, select Cinemachine/Create Virtual Camera

    Step 2: Drag the game object you want the virtual camera to look at onto its LookAt field in the inspector. The camera
    will now look at that object. Drag the virtual camera or the object around, and see. Change the virtual camera's "Aim" method to "Composer" and you will get a bunch of interesting options.

    Step 3: If you want the camera to move in space (instead of just changing its orientation), drag a game object onto the virtual camera's "Follow" field. The virtual camera's position will now be locked to that game object. You can only move the virtual camera by moving the object that it follows (try it and see). Change the virtual camera's "Body" method to "Transposer" and you get another bunch of interesting options.

    That's the general idea.
     
    Alverik likes this.
  3. AaronC

    AaronC

    Joined:
    Mar 6, 2006
    Posts:
    3,552
    Thanks heaps for the lightning fast reply! That's super helpful :)
     
  4. AaronC

    AaronC

    Joined:
    Mar 6, 2006
    Posts:
    3,552
    One last thing, what would we drag onto the timeline, if we wanted to fade from camera to cinemachine camera back to camera?
     
  5. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,728
    Cinemachine timeline lets you blend between Cinemachine virtual cameras. Blends are not fades - they are more like a smooth camera movement from one position to another.

    Cinemachine Virtual cameras (aka vcams) control what the Unity camera does. They are called Virtual cameras because they are not cameras. They are more akin to cameramen than to cameras. When a vcam is active, it is animating the Unity camera. Blending from one vcam to another will animate the Unity camera from one procedural state to another.

    The timeline can be used to control which vcams are active when. If your game camera is implemented using Cinemachine (which is the recommended strategy), then the timeline can be used to smoothly blend to and from cutscenes. If no vcam is active, then the Unity camera will just sit where Cinemachine left it.

    Drag a Cinemachine-enabled Unity camera onto the timeline, select "Create Cinemachine Track" from the popup. Then, right-click on the track to create Cinemachine Shot Clips. Each of these will control a vcam. If you overlap them, they will blend.
     
    AaronC and Alverik like this.
  6. AaronC

    AaronC

    Joined:
    Mar 6, 2006
    Posts:
    3,552
    Ok so thats a Unity camera not a ViirtualCamera..?
    With a fresh empty timeline I see only a create option so I create a timeline (with MainCamera selected)
    Then dragging the same camera on I get the options of an Animation Track, or a Activation track, no cinemachine options.

    If I select a model instead, and create a Timeline, I get the same options when dropping the camera on that too.

    Are you working on a version that has an additional option? I downloaded this stuff over the last couple of days so I should have recent files I would have thought. Maybe you are on a beta of betas?
     
  7. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,728
    First thing to know: vcams are a way to animate the Unity Camera. To do this, the Unity camera must have a component on it called the CinemachineBrain. This is what takes the instructions from the vcams and animates the camera. A brain is automatically created on the main camera when you create your first vcam from the Cinemachine menu. However, you can add brains to other cameras by adding a CinemachineBrain component to them manually.

    Second thing: to get the cinemachine option on the timeline track creation, you must drag a unity cam that already has a brain (you can tell because it gets a little CM icon in the scene tree). It's the presence of the brain that gives you the Cinemachine option.

    So the steps are:
    1. create a few vcams
    2. create a timeline
    3. drag the main camera (it now has a brain) onto the timeline, select "create cinemachine track"
    4. right-click in the shot area of the track and select "create cinemachine shot clip"
    5. click on the new clip to get an inspector for it
    6. populate the Virtual Camera field with one of the vcams from the scene
    7. repeat for additional shots and tracks

    tip: it's a good idea when using timeline to lock it (click the little lock icon on the upper right) otherwise you have to keep finding it again when you click elsewhere.