How do you stop capsule from going through walls?

Hi, I am making a game but my player (capsule) keeps walking through all the houses. I have been trying to add wall colliders but they are not working. (its 3rd person)
Here is my movement code.

using UnityEngine;

public class playerController : MonoBehaviour {

public float mSpeed;

// Use this for initialization;
void Start () {
    mSpeed = 10f;
   
}

// Update is called once per frame
void Update () {
    transform.Translate(mSpeed * Input.GetAxis("Horizontal") * Time.deltaTime, 0f, mSpeed * Input.GetAxis("Vertical") * Time.deltaTime);
   
}

}
here is the 3rd person camera code;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ThirdPerspnScript: MonoBehaviour
{
public GameObject target;
public float rotateSpeed = 5;

void Start()
{
    transform.parent = target.transform;
    transform.LookAt(target.transform);
}

void LateUpdate()
{
    float horizontal = Input.GetAxis("Mouse X") * rotateSpeed;
    float vertical = Input.GetAxis("Mouse Y") * rotateSpeed;
    target.transform.RotateAround(target.transform.position, Vector3.up, horizontal);
    target.transform.RotateAround(target.transform.position, Vector3.left, vertical);
}

}
** finally my mouse aim code; **
using UnityEngine;
public class MouseAimCamera : MonoBehaviour
{
public GameObject target;
public float rotateSpeed = 100f;
Vector3 offset;

void Start()
{
    offset = target.transform.position - transform.position;
    

}

void LateUpdate()
{
    float horizontal = Input.GetAxis("Mouse X") * rotateSpeed;
    target.transform.Rotate(0, horizontal, 0);

    float desiredAngle = target.transform.eulerAngles.y;
    Quaternion rotation = Quaternion.Euler(0, desiredAngle, 0);
    transform.position = target.transform.position - (rotation * offset);

    transform.LookAt(target.transform);
}

}

Few things to check:

1-the colliders are not triggers (in the inspector, see if Is Trigger is unchecked)

2-it is best to add a rigid body to your controller, and translating it through adding force. It will let Physics take care of correctly colliding with other objects in the scene without weird artifacts.