Opening a door as camera approaches

How do I get a door to automatically open as I approach, and close again once I walk through it or walk away from it?

You would set a collider on the door and use a ray cast to hit the door once you are near it. You could then have an animation or do it in code to open the door in a way you'd like... and do the reverse for closing it.

You could also do a collider on collider collision detection but I think ray cast would be better for what you are trying to do.