Search Unity

  1. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Let us know a bit about your interests, and if you'd like to become more directly involved. Take our survey!
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  5. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Blending between two (or more) FreeLooks

Discussion in 'Cinemachine' started by ian00playdead, Jun 4, 2018.

  1. ian00playdead

    ian00playdead

    Joined:
    Sep 20, 2017
    Posts:
    6
    Hey guys,

    Wondering if anyone's found a good workflow for blending smoothly between two or more Freelook cameras?

    Naively I started by simply clone one Freelook camera and then pull it in closer to the player, to use in tighter spaces for example. In this particular case, all I really want is a closer follow distance (with a few small tweaks to make that distance feel right). But otherwise I want these two Freelooks to be basically the same.

    What I'm finding is that these two Camera's x-Axis and y-Axis values quickly become out of step (as you'd expect), and that if you blend from them you also blend their axis values, which isn't ideal.

    I'm also using a custom script to read in input from a controller and apply it to the x and y input axes. The two Freelook cameras would still be out of sync anyway, but I realized also that when the near camera is disabled, its axes aren't updating input either. Which is just one more way for them to fall out of sync.

    I thought of maybe directly assigning the axis-value of any FreeLook cameras from a main one that I use most of the time, but I don't know if this is a good idea either. There's a bunch of math happening for each

    So I suppose I'm wondering if anyone's found a smart way to keep the axis-values of two different Freelooks completely in sync, so that they're safely blendable. Or if there's a smarter way to get the effect I'm after, which is blending the rig-size or follow distance between two Freelooks.

    Really appreciate the help!

    Ian
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    1,636
    What is the binding mode of the FreeLooks that you're trying to blend?
     
  3. ian00playdead

    ian00playdead

    Joined:
    Sep 20, 2017
    Posts:
    6
    Hey, appreciate you hitting me back. Both camera's are set to Simple Follow w/ World Up.
     
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    1,636
    Right. So here's your problem. The heading on SimpleFollow is in Camera-local space, so the axis value will necessarily have different meanings for the different cameras, unless the cameras are in exactly the same place, which would defeat the purpose of having more than one. So even if you gave them all the same value it wouldn't help.

    That said, the upcoming release of Cinemachine (2.2.0, available now for the brave, in preview) has added some features to help in this situation. Specifically, there is a new checkbox on the vcam - Inherit Position - which forces the vcam's position to warp to the current camera position as soon as it becomes live, allowing the vcam's damping to cover the difference between that and the desired position. It's a little esoteric, but it does the job in the situation you describe. The StateDrivenCamera example scene included with the new release demonstrates its use: 3 SimpleFollow FreeLooks at different radii triggered by the player's animation state. They are kept in sync, sounds like what you're looking for.
     
    Last edited: Jun 10, 2018
  5. mradfo21

    mradfo21

    Joined:
    May 16, 2013
    Posts:
    181
    I have this exact problem aswell