Search Unity

CinemachineTargetGroup not keeping targets in view

Discussion in 'Cinemachine' started by naishtech, Sep 22, 2021.

  1. naishtech

    naishtech

    Joined:
    Sep 21, 2018
    Posts:
    20
    Hello, hoping someone can help.

    I have been trying to have a Virtual Camera follow a group of targets using the CinemachineTargetGroup component, however when I move a target far enough out of the screen, the Virtual Camera does not move or zoom enough envelope the targets.

    Here is the issue

    targetgroup.gif



    Here are the Vcam settings



    vcam-settings.png



    Here is the targetgroup settings



    targetgroupsettings.png
     
    Last edited: Sep 22, 2021
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,730
    Your problem is here:

    upload_2021-9-22_8-39-47.png

    You have clamped the minimum and maximum FOV to 3 and 60. It will not zoom more than that. You can try changing these settings.
     
  3. naishtech

    naishtech

    Joined:
    Sep 21, 2018
    Posts:
    20
    Hi @Gregoryl

    Thankyou very much for the quick reply.

    I tried to maximise the FOV and unfortunately had the same problem. I then tried to use the "Dolly Only" (which I expect would only move the camera backwards to fit the objects in view). Although the effect was better I still was able to move one of the targets out of view:

    targetgroup22.gif



    Here are my new settings:

    vcam-settings2.png
     
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,730
    There was a bug in the Group Framing that was fixed very recently, and it might be contributing to this. The fix isn't released yet, but if you would like to send me a simple project that shows this problem, I can check it against the fixed version and see if that's the cause.
     
  5. naishtech

    naishtech

    Joined:
    Sep 21, 2018
    Posts:
    20
    Thanks @Gregoryl

    I have attached the sample project.

    To reproduce, move one of the bottom cubes out of the screen by reducing the Z transform value.
     

    Attached Files:

  6. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,730
    Thanks for the upload. I can confirm that the bugfix does correct the framing issue.

    However, it is still possible to drag the objects to such an extreme that the setup will give up trying to frame everything. There is only so much that the algorithm can do.
     
  7. naishtech

    naishtech

    Joined:
    Sep 21, 2018
    Posts:
    20