Search Unity

Keep LookAt Static while trying to frame multiple game objects (Framing Transposer)

Discussion in 'Cinemachine' started by pherrera25, Nov 16, 2019.

  1. pherrera25

    pherrera25

    Joined:
    Mar 5, 2018
    Posts:
    11
    Hi!

    The Framing Transposer feature is exactly what I have been looking for my camera, but instead of doing a "Group Average" or "Group Center" I'd like to basically have a "Group Leader Object", so the body of the camera would move in and out while always having the "Group Leader Object" in the center of the screen (and keeping the same rotation), but the movement would happen to try to keep the other objects in the target list in the frame until m_MaximumDistance is reached.

    I can't seem to get that to work, but it's very close to what I want... any ideas?
     
    Last edited: Nov 16, 2019
  2. pherrera25

    pherrera25

    Joined:
    Mar 5, 2018
    Posts:
    11
    I meant Follow instead of LookAt :) I want to keep the Follow to one game object, but frame other game object by moving the camera in / out while always centering the one Game Object.
     
  3. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    How about this:
    1. Put only the Group Leader Object in the group
    2. Create a script that dynamically sets the group leader's radius (in the group) to be the same as the distance to the farthest of the other objects that you want to have on screen.
    3. If you take that distance on the plane that is normal to the camera-groupLeader vector, then you will get even better group framing.