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!
void PlayerMovement()
{
float hor = Input.GetAxis("Horizontal");
float ver = Input.GetAxis("Vertical");
Vector3 playerMovement = new Vector3(hor, 0f, ver) * Speed * Time.deltaTime;
transform.Translate(playerMovement, Space.Self);
}
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)
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.