CinemachineConfiner not working

[Edit]
I did some debugging and it looks like the main camera and the virtual cameras are getting restricted correctly but when the player moves close to the boundary I can still see the area outside the bounding box. This should not be happening.
More clarification on the above:
When moving the player close to the boundary I can see that the main camera gizmo gets stuck to the boundary as expected and its transform position stays constant (minute decimal changes but thats fine). The gizmo for the cinemachine camera also seems to get stuck (Now this could be the cinemachine lens gizmo and not the cinemachine camera gizmo ?) but its transform keeps updating along with the player position (eventually consistent). I think this is the main issue here because of which the area outside the bounding box is also visible.

[Original Question]
I am trying to use the CinemachineConfiner and have followed steps from various tutorials and docs but I just cant seem to get it to work i.e. there doesnt seem to be any collision triggering for the camera and the camera moves as it does when the collider and the CinemachineConfiner were not present.

I have tried with both the CinemachineConfiner and CinemachineConfiner2D extensions. I tried changing the collider to trigger and not a trigger.
I also confined the collisions to the same layer (Cinemachine) for both the camera and the LevelBounds object that contains the polygonCollider to ensure that no other object collision foo is going on.

I am at a loss here. please help!

Adding some snaps to show all my current settings in detail. Please let me know if more information is required.

Project: unity2d
Main camera and the cinemachine camera are the white box, polygon collider for bounds is the green box outside the white box:

Cinemachine camera settings:

Bounding box object settings:

Main scene camera settings:

This was due to my stupidity. I had added a pixel perfect component to the cinemachine virtual camera. This component adds its own camera to the cinemachine virtual cam. This causes the control to shift to the pixel perfect added camera component once the main cam gets stuck in the bounding box.
I removed the camera component from the virtual cam and everything works perfectly now.

1 Like