How to stop the Camera from going through the floor

Hello I really could use some help with this!

I have a Camera in which I have placed a sphere capsule and a plane which has a box collider on it. With the Camera I have a script which allows me to orbit an object (all the way around it) However when I orbit around the object the camera goes through the floor, even when there are colliders on both of camera and plane.

How will I be able to stop this from happening?

You need to give the camera a RigidBody as well, otherwise no collision will be registered. Alternatively, if the floor is the same height everywhere, you can also restrict the camera’s y position via code.