Character Controller rotate unity

I am using a joystick to make the character move using the CHaracter Controller script like this:

var jumpSpeed : float = 8.0;
var gravity : float = 20.0;
var moveJoystick : Joystick;
var speed: float = 1.0;
var turnSpeed:float = 1.0;
var angle: float = 1.0;

private var moveDirection : Vector3 = Vector3.zero;

function Update() {
        var controller : CharacterController = GetComponent(CharacterController);
        moveDirection.y -= gravity * Time.deltaTime;

        if (moveJoystick.position.y>0) {
                controller.Move(Vector3.forward * moveJoystick.position.y * speed);
        }
        else { 
                controller.Move(-Vector3.forward * moveJoystick.position.y * speed); 
        }
        controller.Move(moveDirection * Time.deltaTime);
        angle = Mathf.Atan2(moveJoystick.position.x, transform.rotation = Quaternion.Euler(new Vector3(0, angle,0));
}

The only problem is that the player does not move towards the direction it is facing. It just keeps going forward all the time.

On line 15 and line 18 replace ‘Vector3.forward’ with ‘transform.forward’. Vector3.forward is shorthand for Vector(0,0,1) and represents the forward direction in the local coordinates of the object. ‘transform.forward’ is forward in world coordinates. It is the same as:

transform.TransformDirection(Vector3.forward);