How to implement a camera secret system like the Hollow Knight one?

I’m building a simple 2d platforming game, and i’d like to implement small secrets in some levels. What i can’t accomplish is that the camera shouldn’t go over a specific area until the player gets there, which can or can’t happen depending on him. I tried with the cinemachine attachments like camera offset, recomposer and confiner, but i can’t seem to get it right.
Here is an example of the hollow knight style camera on discovering a secret:
6951995--817964--ezgif.com-gif-maker.gif
As you can see the camera doesn’t “enter” that wall until the player goes through it, because it is a secret area.

How can i achieve this type of effect smoothly like that in my game?
Here is a screenshot of the instance where i’m trying to implement that:


Over the flag there’s a secret area with a reward and a message, the camera doesn’t go through because of the cinemachine camera confiner but i don’t know how to get the camera to move smoothly to that area.
Anyone has solutions? Thanks in advance.

Have a second vcam without the confiner. When the player crosses the boundary, enable it and the brain will do the blend.

2 Likes

Wow thanks I’ll try