Search Unity

ClearShot not switching to second camera when target falls out of first camera's frustum

Discussion in 'Cinemachine' started by andreyefimov2010, Sep 8, 2018.

  1. andreyefimov2010

    andreyefimov2010

    Joined:
    Oct 29, 2017
    Posts:
    44
    The Problem from 1.9~ persisted after update to 2.2 - https://forum.unity.com/threads/fix...w-up-camera-when-falling-out-of-sight.535629/. It was commented there that this issue should be fixed in 2.2 but it doesn't seem to be working for me.
    To reiterate, I have two virtual cameras under ClearShot. The first one is static, the second one is standard third-person with Body set to "Framing Transposer". Both have LookAt target set and the second has Follow target. Also, Cinemachine Collider is added to parent ClearShot object.
    I expect the first camera (static) to be active when the character (target) is seen in its view (in its frustum) and switch to third-person camera when it falls out of its frustum.
    Current behavior is that when I move the character out of first camera frustum it doesn't get switched to TPC and character becomes not shown in the view.
    The only difference I've got after update is that the camera jerks a bit right at the moment character moves out of the view of the static camera, but that's about it.
     
    Last edited: Sep 8, 2018
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,728
    It's working for me. A common mistake with the collider is to forget to make sure that it doesn't consider the target itself to be an obstacle. Possibly what's happening is that the dynamic vcam also thinks the target is obscured, so it's not switching. Try setting the minimum distance from target setting in collider to be large enough to exclude the target. You can also tag the target (and all the shapes inside it) and then set the collider to ignore objects with that tag.
     
  3. andreyefimov2010

    andreyefimov2010

    Joined:
    Oct 29, 2017
    Posts:
    44
    Thanks for the answer. Ignoring the target's objects worked. However, there's some leeway between the the moment target is out of static camera's view and switching to TPS. Only after target is far enough from static camera frustum the cam is switched to TPS.
    EDIT: nevermind, increasing Minimum Distance From Target helped :)
     
    Last edited: Sep 9, 2018
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,728
    It switches right away for me. Show me your settings. A video would help too.