Search Unity

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:
    7,728
    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:
    7,728
    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
    YogeshSR likes this.
  5. mradfo21

    mradfo21

    Joined:
    May 16, 2013
    Posts:
    194
    I have this exact problem aswell
     
  6. Dazo1985

    Dazo1985

    Joined:
    Mar 13, 2019
    Posts:
    26
    Thank you so much "inherit position" fixed my problem too
     
  7. tetto_green

    tetto_green

    Joined:
    Dec 22, 2015
    Posts:
    35
    Love your asset! You made it kinda role model asset) Thanks for your work, cheers!