Rotate Character on Sphere

Hey guys I am currently using the following script for my movement around a sphere;

This works great however I wanted to change the controls a bit, so currently I can move my ship around using WASD which works fine. However my ship is not rotating.

What I want to have is that my ship is rotating into the direction the player is moving, using the rotation available in this script will make the character endlessly rotating however I want that it stops as soon as he faces the direction it moves in.

Any clues how this could be achieved on a sphere with the current script ?

Here is my current script:

    using UnityEngine;
    using System.Collections;
    public class OrbitMovement : MonoBehaviour
        GameObject orbit;
        float radius;
        public float moveSpeed;
        public float rotateSpeed;
        public float angleX = 0;
        public float angleY = 0;
        public float angle = 0.0f;
        public Vector3 direction =;
        public Quaternion rotation = Quaternion.identity;
        public virtual void Start()
            //Get Orbit GameObject
            orbit = GameObject.FindGameObjectWithTag("Orbit");
            float objectRadius = 0f;
            //If gameObject hast Box or Sphere Collider add its size to the moving radius
            if (gameObject.GetComponent<BoxCollider>())
                objectRadius = gameObject.GetComponent<BoxCollider>().bounds.size.x/2;
            //Define final radius for objects to move on
            radius = (orbit.GetComponent<SphereCollider>().radius) * orbit.transform.localScale.x + objectRadius;
        // Update is called once per frame
        public virtual void Update()
            //Set direction
            direction = new Vector3(Mathf.Sin(angle), Mathf.Cos(angle));
            //Trigger Update Position
            Vector2 input = new Vector2(Input.GetAxisRaw("Horizontal"), Input.GetAxisRaw("Vertical"));
            Vector2 moveDirection = new Vector2(input.x, input.y);
            moveDirection *= moveSpeed;
        //Method for updating the objects position
        void UpdatePositionRotation()
            transform.localPosition = rotation * Vector3.forward * radius; 
            transform.rotation = rotation * Quaternion.LookRotation(direction, Vector3.forward);      
        public void Translate(Vector2 moveDirection)
            Translate(moveDirection.x, moveDirection.y);
        public void Translate(float x, float y)
            Vector3 perpendicular = new Vector3(-direction.y, direction.x);
            Quaternion verticalRotation = Quaternion.AngleAxis(y * Time.deltaTime, perpendicular);
            Quaternion horizontalRotation = Quaternion.AngleAxis(x * Time.deltaTime, direction);
            rotation *= horizontalRotation * verticalRotation;
        //Set Spawncoords of Object at predefined location
        public void SpawnLocation(float x, float y)
            //Update direction
            direction = new Vector3(Mathf.Sin(angle), Mathf.Cos(angle));
            Vector3 perpendicular = new Vector3(-direction.y, direction.x);
            Quaternion verticalRotation = Quaternion.AngleAxis(y, perpendicular);
            Quaternion horizontalRotation = Quaternion.AngleAxis(x, direction);
            rotation *= horizontalRotation * verticalRotation;