Camera follow and unfollow

Hello everyone! I’m currently new to Unity3D and I’m kinda having a problem with how the camera will follow and unfollow the player at certain point.

I’m creating a megaman clone as a practice and I wanted to achieve something like when the player is near a door, the camera will stop following the player then when he touches the door, the camera will shift into a certain view.

I don’t really know how to explain this but please look at this video of what I’m talking about:


How will I achieve something like that? any ideas please?

EDIT: if I make the camera child of the player then this happens. How can I make it stop following when near the door
33072-boss.png
(Please ignore the marker “Event Process onCollide” I was asking a friend about that and he pointed me at this site haha)

I believe the solution will be to limit your camera movement to some bounds… You will need to know exactly how far the camera can move. Which means knowing your level layout.

In some script, have it check wether it’s trying to move outside those bounds, and prevent it from doing so.

Then, when you hit the door, you want to have a simple translation, Lerp (tutorial) should get you through that.

i don’t believe the information is precise enough, But it’s a good starting point.