Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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

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

  1. slowDrag0n

    slowDrag0n

    Joined:
    Oct 10, 2017
    Posts:
    41
    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:
    7,658
    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.