I made a door with open/close animations and a box collider. Everything works fine except when you stand in front of the door in its path and click to open/close it passes right through you.
The animation is modifying the mesh and/or one or more “bones” (child objects) in the door’s “skeleton,” depending on how the animation is set up. The box collider is tied to the main game object, so it doesn’t follow the mesh. In the Scene View, select the door. You should see a green wireframe representing the box collider. When you open the door, you’ll probably see the door mesh move but the collider stay in place.
One way to fix this is to attach a collider to one of the child objects that actually get moved in the animation, and get rid of the collider on the main game object.
Another way, depending on your needs, is to change the shape of the collider so that it represents the open door position when you open the door. (Or have two colliders and enable/disable them as you open/close the door.) This will allow the door to pass through you while it’s opening – but, once open, you can’t walk through the door mesh. From a user interface standpoint, this is sometimes nicer because the door doesn’t try to shove you out of the way as it’s opening.
And yet another way is to use a Hinge Joint.