Collision does not work, player can walk through walls

So I have a character with a non-kinematic rigidbody that does not use gravity. The character also has a box collider around it that is not a trigger. My character is walking along a plane with a mesh collider, turning on gravity does not cause them to fall. I am trying to put box colliders along the sides of the plane to stop my player from walking off. I have tried both using root motion for movement of my player/character as well as using translate and rotations on the transform of my player. I most recently tried a character controller to see if it would make any difference but to no avail.

I have a debug print out for the collison. The player collides according to the debug log in my oncollisionenter but is able to walk right through the wall out into oblivion. How do I get collision to work? My player is able to walk through my invisible wall boundaries, trees, enemies, everything. I have also tried discrete, continuous, and continuous dynamic on the rigidbody. I just want my character to not be able to move through colliders and be forced to move around them or walk back from the world boundaries.

My current movement code for those asking:

[SerializeField]
public float speed=2f;
[SerializeField]
private float defaultSpeed = 2f;

[SerializeField]
private Transform playerGraphic;
  
private Animator controller;

private void Start{
   controller = this.gameObject.GetComponent<Animator>();
}

private void Update() {
    if (!controller.GetBool("dead"))
    {
             Movement();
             if (Input.GetKey(KeyCode.W) || Input.GetKey(KeyCode.A) || Input.GetKey(KeyCode.D) || Input.GetKey(KeyCode.S))
            {
                controller.SetBool("walk", true);
            }
           
      }
}
private void Movement()
{

        //Player object movement
        float horMovement = Input.GetAxisRaw("Horizontal");
        float vertMovement = Input.GetAxisRaw("Vertical");


        if (horMovement != 0 && vertMovement != 0)
        {
            speed = defaultSpeed - .5f;
                       

        }
        else
        {
            speed = defaultSpeed;

        }
        transform.Translate(transform.right * horMovement * Time.deltaTime * speed);
        transform.Translate(transform.forward * vertMovement * Time.deltaTime * speed);
        
        //Player graphic rotation
        Vector3 moveDirection = new Vector3(horMovement, 0, vertMovement);
        if (moveDirection != Vector3.zero)
        {
            Quaternion newRotation = Quaternion.LookRotation(moveDirection);
            playerGraphic.transform.rotation = Quaternion.Slerp(playerGraphic.transform.rotation, newRotation, Time.deltaTime * 8);

        }
    }

do the walls have colliders?

Perhaps you’re moving too quickly for the fixed delta time. Try changing the time step by going into

Edit → Project Settings → Time

and changing the Fixed Timestep to maybe 0.01 (100 FPS). If that doesn’t work, something’s wrong with your colliders.

EDIT: Also make sure that Is Trigger is unchecked with colliders you want to stop your player.

I understand your player movement is through character controller. So now I want you to try adding mesh collider component to your walls. Make sure you check on “Convex” option in the mesh collider.
If your walls have a box collider, also check on “Is Trigger” option in it.
Try it and let me know if this worked.