Cinemachine Collider don't work

I’m using a Follow Target as the Look At target for my Cinemachine Virtual Camera, and I control the rotation of the Follow Target using a script. Could this be the reason why the Cinemachine Collider is not working properly?

    private void RotateTarget(Angle pitch,Angle yaw)
    {   
        var targetAngle = _followTarget.transform.rotation.eulerAngles;
        _followTarget.transform.rotation = Quaternion.Euler((float)pitch, (float)yaw, targetAngle.z);
    }

The 3rdPersonFollow component has its own built-in collision resolver, you should not use the CinemachineCollider with it.

That said, looks like you have a pretty weird ThirdPerson setup. Check out this excellent tutorial for a more standard way to do things:

A few months ago, I watched the video and followed its instructions to modify my setup to the current state. I’ve now removed the custom collider and set up the built-in collision, but the camera still passes through objects.
0824 - Untitled - Windows, Mac, Linux - Unity 2022.3.20f1 DX11 2024-12-17 00-29-23

Can you show the vcam inspector, with all the components visible?
I can’t see it clearly in the video.

Those settings will keep the camera out of objects that have colliders on them. Do all the relevant objects in your scene have appropriate colliders?

Yes, my objects all have components like MeshCollider. When I move my character prefab directly in the Editor, the camera collision seems to work properly. However, when I control the character during gameplay, the camera still clips through objects.
0824 - Single01 - Windows, Mac, Linux - Unity 2022.3.20f1 DX11 2024-12-17 20-01-53 (1)

I’m not seeing any clipping in your video.

Can you make a simple scene with a single mesh and show how the camera clips through it? Note that if the mesh forms a cave that your character enters, you will need to model both the inside and the outside of the walls, forming a two-sided closed surface into which your character never goes.

When I play the game, my camera clips through obstacles, but when I move the character in the Scene view by dragging it with the mouse, the camera collision appears to work correctly.
11

12

I just found when I move the character through scene the camera still clip
13

It works correctly for me when I try it.

What is different about your vcam and/or your obstacle in and out of play mode?

If you would like to send me the test scene, I can take a look at it (please don’t send your whole project)

When I selected the scene and its dependencies for export, I found that the camera started working properly after I deleted some objects. So now I’m testing to see which objects are causing the camera clipping issue.

1 Like