Search Unity

Pull camera forward and player occlusion

Discussion in 'Cinemachine' started by Mars91, Oct 10, 2019.

  1. Mars91

    Mars91

    Joined:
    Mar 6, 2012
    Posts:
    572
    I'm using a Cinemachine Collider component with Pull Camera Forward on a FreeLook camera everythig is working sort of fine I only have a couple of complains.

    - As soon as a collider occlude the player the camera immediately jump forward, how can I avoid this for small object as trees or similar without setting a camera transparent layer?
    - How can I make the camera collision "smoother"?

    Screenshot (142).png
     
    Last edited: Oct 10, 2019
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,730
    It's a hard problem, and difficult to solve perfectly for all situations. You can improve things, however, by adjusting some settings.

    Increasing the "Minimum occlusion time" will avoid pulling forward for brief occlusions such as trees. That's how long the subject has to be hidden before the camera is pulled forward.

    Increasing the "Damping when occluded" will make the camera lerp forward instead of popping.

    Increasing the "smoothing time" will make the camera linger in the pulled forward position before pulling back. This helps smooth things out when there are multiple bumpy obstacles.
     
  3. Mars91

    Mars91

    Joined:
    Mar 6, 2012
    Posts:
    572
    Still doing some testing adjusting both dumping and using a transparent layer for the camera in order to avoid having the camera going crazy inside a forest or any other densely populated area.