Search Unity

Bug cinemachine colliders don't work

Discussion in 'Cinemachine' started by laurentlavigne, Oct 12, 2022.

  1. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,364
    here is what i do
    i add a cine collider and turn off avoid obstacles -- which should be called avoid occlusion -- and the camera still penetrates the ground, unless i move verrrry slowly

    so it seems that it is not firing a longer ray when the delta move is large
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,730
    Can you show an image or video of the problem. Also please an image of the vcam inspector.
     
  3. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,364
    sure
    upload_2022-10-12_8-45-55.png
    upload_2022-10-12_8-44-9.png
    Code (CSharp):
    1. using Cinemachine;
    2. using UnityEngine;
    3.  
    4. public class FreeLookController : MonoBehaviour
    5. {
    6.     float radius=1;
    7.     float radiusBottom, radiusMiddle, heightTop;
    8.     CinemachineFreeLook _freelook;
    9.     public Vector2 minMax = new Vector2(0,15);
    10.     public float scrollSpeed = 8;
    11.     void Start()
    12.     {
    13.         _freelook = GetComponent<CinemachineFreeLook>();
    14.         radiusBottom = _freelook.m_Orbits[2].m_Radius;
    15.         radiusMiddle = _freelook.m_Orbits[1].m_Radius;
    16.         heightTop = _freelook.m_Orbits[0].m_Height;
    17.     }
    18.  
    19.     void Update()
    20.     {
    21.         radius = Mathf.Clamp(radius+ Input.GetAxisRaw("Mouse ScrollWheel")*scrollSpeed * Time.unscaledDeltaTime,minMax.x, minMax.y);
    22.         _freelook.m_Orbits[2].m_Radius = radiusBottom + radius;
    23.         _freelook.m_Orbits[1].m_Radius = radiusMiddle + radius;
    24.         _freelook.m_Orbits[0].m_Height = heightTop + radius;
    25.     }
    26. }
    27.  
     
  4. EricChan

    EricChan

    Joined:
    Jul 14, 2014
    Posts:
    8
    upload_2022-10-13_16-59-48.png

    Have you tried to change your Minimum distance from target?
     
  5. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,730
    Yes, you have minimum distance from target set to 20 - which means that it will ignore all obstacles within 20m of the target
     
  6. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,364
    Thanks. I changed it back to 0.1, I thought it was for occlusion only.