Cinemachine Confiner with Ortho Camera looking at world obliquely: Jitters / Shakes at Corners

I’m wondering how to implement a confiner in a 3D world with an orthographic camera that is looking at the world obliquely from an angle.

Here is a view from the Camera view angle. The yellow outlined box is the Bounding Volume (a skewed cube with a Mesh Collider) and the white outlined box is the camera viewport.

From another angle (below):

This works perfectly until the camera starts hitting the edges, particularly when it gets close to a corner the camera starts to jitter / shake.

Why is the jitter / shake happening, is there something I’m missing?

Thanks.

It’s seems like it might be just simpler to use the 2D Confiner. Through my testing this doesn’t have any jitter with the skewed diamond-like Bounds.

1 Like

I’d try with 2D confiner. If your game is like Luigi’s Mansion, then it should work: Cinemachine Luigis Mansion 3 Style Camera

1 Like

Nice, it’s very similar but our camera needs to be non-perspective.

Thanks for the link, I’ll check out the resources you provided in that post too.

I tried the CinemachineConfiner2D extension (like in the Cinemachine Scene 2D Confiner in the examples), and once I try rotating the Camera it causes pretty bad jittering. I think most of my issues are coming from having to look at the world from an angle (above-right).

The only way I can get it working is using the CinemachineConfiner extension (not 2D) with a 2D Polygon Collider that is also rotated along with the camera.

The only drawback for this is you can’t set “Confine Screen Edges” true or the jittering happens again, which would be nice to have since the game’s ortho size can change.

Could you send me a simplified project? I’d like to experiment with it, because it may be a use case we did not cover. :hushed:

Sure thing, just DMed you.

Actually from more testing it seems I can’t use 2D since I need the Z axis. It seems using an upright 3D bounding volume not facing the camera that sits above the plane actually works but there is a lot of trial-and-error.

Using Confine Screen Edges this way though still sometimes jitters at the corners when the bounding volume has acute angles (like in the case of a skewed cube which I’m using for my bounding volumes).