Search Unity

Focus multiple targets with 2d cinemachine camera by increasing or decreasing ortho size only?

Discussion in 'Cinemachine' started by firsttry21, Feb 3, 2019.

  1. firsttry21

    firsttry21

    Joined:
    Oct 10, 2017
    Posts:
    8
    I would like to keep an object in the center of the viewport while targetting multiple objects with cinemachine 2d group target camera but i cant seem to find a correct configuration for that. Is there a way to do so? if so how can i achieve such behaviour?
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    2,845
    You won't get that out of the box, without a little scripting. Here is how to do it: put a single item in the TargetGroup, and adjust its radius dynamically from your script, according to the distance to the farthest of the other target objects.