Confiner 2D Damping not working

I am changing changing the size of the confiner’s BoundingShape2D at runtime an then calling the InvalidateCache() method on the confiner, and anytime I change the size the camera instantly snaps to the inside of the new confiner, regardless the damping value in the inspector.

I’m using a PolygonCollider2D as the BoundingShape2D.

Is this a bug and is there any way to fix this or am I doing something wrong?

Note: I know I can use two virtual cameras, but that would not fit in the game at all and would be weird to implement
I also tried lerping the confiner size, which sort of worked, but not completely because every few frames the camera would teleport to an incorrect position and then on the next frame work normally again.

Could you describe why using two vcams and two confiners is not a good solution for you?
For example:
vcam a - confiner small
vcam b - confiner big
Instead of changing the collider input of the confiner, you switch vcams.

I am creating a level editor, in which you will be able to change camera size and confining at runtime, I cannot really create a new vcam for every change, but i also figured it out, I lerp the confiner from only one side and it doesnt teleport the camera anymore and works as I wanted it to

1 Like