Weird camera jumps

Hi, my cinemachine confiner does not work as expected. There is one wall, where going up with camera “touching” the collider results in a sudden change of camera position, without any smooth transition. When I go down again, camera is stuck and the player is out of view, until I move further.
I tried changing the angle of the wall collider, but with no results.

In general, in some places, even not close to the walls, the camera sometimes does sudden movements, sometimes looses track of the player.

Increasing confiner’s damping helps with sudden movements, but also results in looking outside of the collider a bit.
ezgif.com-gif-maker (4)

Why is it happening and how do I fix it?

EDIT: and also in different place:
image
it doesn’t collide with the collider (without damping on)

Hi Jasin,

Try to select the Confiner2D instead of the Confiner that Rick selected in the dropdown menu.

Thanks! It’s so much better now :slight_smile:
I’m surprised no one before has reported this issue here

Okay, it is better, but still there are some weird places where it doesn’t fully work, like here:

My camera just ignores the collider in this place.
(the thin orange line is not the collider, but the thick one is)

Also going up the ladder in that place sometimes results in a sudden camera jump. I’ve made the corner more roundy, but it didn’t help.

image

When my collider is very straight, the camera doesn’t go behind it, but then the camera jump is much bigger.
ezgif.com-gif-maker (5)

I did some research, and it might be that the effect in your gif is a problem in the cinemachine asset. In this thread, somebody wrote they were working on a more robust solution but I do not know if that solution was implemented.

What value does “Interpolate” in your player’s Rigidbody2D component have? Maybe setting it to “Interpolate” could improve the behaviour.

It had “none”. I’ve set it to interpolate, but it didn’t help. Maybe I should just change my level layout to avoid corners like this.

Is the UpdateMethod in the CinemachineBrain component set to “Late Update”?

Before you change your designs, build your game and test your build. Since the game window is just a (laggy) preview, there is a chance that you do not encounter this visual issue in the build.

Also feel free to report a bug to Unity via Help > Report a bug. Send them your gif along with your game. Maybe their programmers know a solution or could fix it in the future.

Privacy & Terms