Character Controller goes through objects

Hello! I just started using Unity, and I’ve got kind of stuck.

I’ve created some cubes, and a Player cube. If I put a RigidBody component on the Player cube, it doesn’t go through other objects. However, if I make it a Character Controller, it goes straight through!

How can I use a Character Controller without the Player going through the walls?

Don’t use transform.Translate or transform.position because those are teleportation. You need to use .Move or .SimpleMove with CharacterController.

Try using the default Character Controller in Standard Assets → Character Controllers.
They have Third Person Controller and First Person Controller. Get to know that for a while before you make your own controllers.