Search Unity

Using a transposer to frame 2 objects

Discussion in 'Cinemachine' started by popMark, Mar 21, 2018.

  1. popMark

    popMark

    Joined:
    Apr 14, 2013
    Posts:
    114
    Hi,

    I'm trying to create a virtual camera that will frame 2 objects, like the face and hand in this stock image. Ideally the face will be constrained to the top half of the screen and the hand to the bottom half, and the camera should be in front of the face but it's position is not affected by the hand orientation.



    The LookAt seems fine, it frames both nicely, but is there a nice way of getting a transposer to position itself this way? I currently have a behavior moving a transform to where I think it ought to be and a Hard Lock transposer following it, but I lose out on some of the smoothing stuff that way
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,730
    Instead of a hard lock, you could follow your transform with a transposer with zero offset. Then it can have some damping.

    Alternatively, if you can have a fixed positional relationship relative to the head, you could follow the head with the appropriate offset and damping.
     
    popMark likes this.
  3. popMark

    popMark

    Joined:
    Apr 14, 2013
    Posts:
    114
    @Gregoryl cheers! I had tried that but hadn't spotted the default of -10 on z offset, which happened to be about my camera's position anyway so I assumed it wasn't moving :confused: