Search Unity

  1. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  4. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Cinemachine Composer Not Targeting Correctly

Discussion in 'Cinemachine' started by gww2, Sep 10, 2018.

  1. gww2

    gww2

    Joined:
    Jan 13, 2017
    Posts:
    7
    I'm working on a vcam setup for tracking two creatures fighting. The virtual camera does not appear to actually target the targetgroup position, instead it seems to be offset towards one creature or the other.

    Here is what the active virtual camera shows
    upload_2018-9-10_13-25-52.png

    The actual transform position however is clearly further left:
    upload_2018-9-10_13-26-29.png

    Here is my virtual camera settings as well:
    upload_2018-9-10_13-28-10.png

    I'm currently running 2.2.7.
     
  2. gww2

    gww2

    Joined:
    Jan 13, 2017
    Posts:
    7
    For now I've rolled back to the asset store version (2.1.10) as that seems to work as expected. Would love to figure out whats going on with this so we can take advantage of cylindrical blend hints for transitions.
     
  3. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    1,533
    The old (2.1.10) group composing algorithm simply framed the bounding box of the group. The bounding box was the smallest box (aligned to the camera's axes) that could enclose all the members of the group, taking into account their radii. This generally worked, except that when the group members were at different depths it could produce lopsided results.

    The new (2.2.x) group composing algorithm is more sophisticated, and tries to center the group's bounds in screen-space. To do this it considers the screen-space square that bounds the group (taking member radii into account). The center of the bounding box is not considered. Looking at your image, that appears to be what's happening. The box around the characters is nicely framed.

    If this is not the behaviour you want, you can try to adjust the radii of the members in your target group (what are they set to now?). Or, instead of using the group composer you can use a normal composer that looks at the group. That will use the group center as the LookAt point.
     
  4. gww2

    gww2

    Joined:
    Jan 13, 2017
    Posts:
    7
    That explains the behavior we're seeing.

    The radii are set based on the bounding boxes of the creatures, which are player generated so can be wildly different values.

    With the normal composer we lose the dolly/zoom to frame the fight, which makes it a no go for us as the creatures are constantly moving and we need the camera to pull in/out to capture the action.

    Its a bit frustrating that we lose the control of the targeting if we want framing.
     
    xdkSPG likes this.
  5. gww2

    gww2

    Joined:
    Jan 13, 2017
    Posts:
    7
    Another composer issue in 2.1.10 is that the framing dolly/zoom ignores the target offset.

    Would really like to be able to upgrade to 2.2.7 for the blend hint transitions still, is there any way to override the framing center target in the group composer?
     
    JohnTomorrow and xdkSPG like this.