Character pass trought wall...

Hello, i have a little problem, i know thats its not a big problem but i dont know how to repair it. my character pass trought wall with one script but not with the other…
with this script (The Good) i pass trought my wall :

var speed = 13;
var gravity = 20.0;

private var moveDirection = Vector3.zero;
private var grounded : boolean = false;

function FixedUpdate() {
    if (grounded) {

if (Input.GetKey("w") || Input.GetKey("s"))

    {
       transform.Translate(0, 0, Input.GetAxisRaw("Vertical") * Time.deltaTime * speed);   //Axe Z
    }

if (Input.GetKey("a") || Input.GetKey("d"))
    {
       transform.Translate(Input.GetAxisRaw("Horizontal") * Time.deltaTime * speed, 0, 0);   //Axe X
    }

    }

    //Mettre la gravité
    moveDirection.y -= gravity * Time.deltaTime;

    // Bouger le joueur
    var controller : CharacterController = GetComponent(CharacterController);
    var flags = controller.Move(moveDirection * Time.deltaTime);
    grounded = (flags & CollisionFlags.CollidedBelow) != 0;
}

@script RequireComponent(CharacterController)

and with my older script he did not pass :

var speed = 13;
var jumpSpeed = 8.0;
var gravity = 20.0;

private var moveDirection = Vector3.zero;
private var grounded : boolean = false;

function FixedUpdate() {
    if (grounded) {

       moveDirection = Vector3(Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical"));
       moveDirection = transform.TransformDirection(moveDirection);
       moveDirection *= speed;

       if (Input.GetButton ("Jump")) {
         moveDirection.y = jumpSpeed;
       }
    }

    //Mettre la gravité
    moveDirection.y -= gravity * Time.deltaTime;

    // Bouger le joueur
    var controller : CharacterController = GetComponent(CharacterController);
    var flags = controller.Move(moveDirection * Time.deltaTime);
    grounded = (flags & CollisionFlags.CollidedBelow) != 0;
}

@script RequireComponent(CharacterController)

My wall have a mesh collider on it because it is a model 3D … This one : 100% Free PNG Images to use [1,000,000+ PNGs]- FastPNG 1.FBX

With one of the scripts, you are translating the player, so you are in effect pushing him,

With the other script, your changing his transform.position,

Transform.position override the physics it’s as simple as that.

the scripts use different movement commands, one is relative to player the other is relative to world position. if you want to override the wall, you can turn off the wall collider if character wall distance smaller than 1.