Prevent player from walking through/pushing walls that are Rigidbodies and have Box colliders

I have a player ( camera object ) in Virtual Reality Environment. The player is in a room with objects like a table and walls. The tables and walls both have a rigidbody and a box collider on them. I messed with the player adding a rigidbody and capsule collider, but I end up either walking through walls, pushing walls, or flopping over as a result of running into the table. I set the walls and table’s Rigidbody mass to max 1e7?

How do I make it so that the player simply cannot walk through the table nor walk through the walls without pushing each other?

You don’t need a rigidbody to stop your character from walking through walls. The OVR utility from Oculus has a Player Controller (with a CharacterController component) which handles this. If you want to achieve it by yourself, you can use a Capsule collider (CharacterController already has it) and stop the transfrom on a collision.

But, if your aim is also to stop the Camera from looking through objetcs, that’s a bit tricky. Keep in mind that CharacterController is moved by using buttons on the remote, or by some kind of game controller. So, it is easy just to stop reacting to the input by the user. What you can’t stop, is the positional tracking of the headset, which is strictly synced with the Camera.

As a fast solution to all of these, there is an asset called Head Collision VR. I also refer to the problem of head collision in depth in this answer.