This is the code I am using to move my character. i have a rigid body, box collider and a mesh collider on my player. i have box and mesh colliders on all my slopes and walls but im still having problems!
float hor = Input.GetAxis("Horizontal");
float ver = Input.GetAxis("Vertical");
Vector3 playerMovement = new Vector3(hor, 0f, ver) * Speed * Time.deltaTime;
I think this video will help you out.
And to fix the problem of going through the wall, as @rh_galaxy
mentioned, you can set the collision detection to continuous, but it comes with a cost as stated in unity docs “This has a big impact on physics performance” (Unity - Manual: Rigidbody component reference
I recommend watching this great tutorial by Sebastian Lague on Creating a 2D Platformer movement, you’ll learn the concepts of handling slope movements and many more. [Unity] Creating a 2D Platformer (E01. set-up) - YouTube
Set the Collision Detection to Continuous for the players rigid body. Also you should consider doing the movement by changes to the rigid body (.MovePosition() or .AddForce()), and not by transform.Translate.