transform.position and box colliders

I am making a top down shooter, that uses WASD for movement.

I have a few boxes in my scene that have box colliders on. Right now I'm using the following script for movement

    var translation : float = Input.GetAxis("Vertical") * MoveSpeed; //AD
    translation *= Time.deltaTime;
    transform.position.z += translation;

    var strafe : float = Input.GetAxis("Horizontal") * StafeSpeed; //WS
    strafe *= Time.deltaTime;
    transform.position.x += strafe;

but I read that this overrides colliders and allows the object to still pass through. Is there a way where I can keep this control style (its in conjunction with mouse look)?

Use rigidbody.MovePosition.