Smooth Rotation For Top-Down Character

Hi there, my game I’m working has a character viewd through a camera looking down at a 45 degree angle. The Character is meant to move on all 8 axis and transform his rotation in each direction. I was able to figure out how to make all the transformations and give velocity to the character in the facing direction. However the transition between directions is instantaneous and looks very bad. I’d like it to be slowed down a bit and smooth.

Here is the current Script that cause movement:

var Speed : float = 2;

function Update () 
{
	if(Input.GetKey("w") && !Input.GetKey("a") && !Input.GetKey("d"))
	{
		rigidbody.velocity = Vector3(0,0,1) * Speed;
		transform.eulerAngles = Vector3(0,0,0);
	}
	if(Input.GetKey("w") && Input.GetKey("a"))
	{
		rigidbody.velocity = Vector3(-1,0,1) * Speed;
		transform.eulerAngles = Vector3(0,-45,0);
	}
	if(Input.GetKey("w") && Input.GetKey("d"))
	{
		rigidbody.velocity = Vector3(1,0,1) * Speed;
		transform.eulerAngles = Vector3(0,45,0);
	}
	if(Input.GetKey("s") && !Input.GetKey("a") && !Input.GetKey("d"))
	{
		rigidbody.velocity = Vector3(0,0,-1) * Speed;
		transform.eulerAngles = Vector3(0,-180,0);
	}
	if(Input.GetKey("s") && Input.GetKey("a"))
	{
		rigidbody.velocity = Vector3(-1,0,-1) * Speed;
		transform.eulerAngles = Vector3(0,45,0);
	}
	if(Input.GetKey("s") && Input.GetKey("d"))
	{
		rigidbody.velocity = Vector3(1,0,-1) * Speed;
		transform.eulerAngles = Vector3(0,-45,0);
	}
	if(Input.GetKey("a") && !Input.GetKey("w") && !Input.GetKey("s"))
	{
		rigidbody.velocity = Vector3(-1,0,0) * Speed;
		transform.eulerAngles = Vector3(0,-90,0);
	}
	if(Input.GetKey("d") && !Input.GetKey("w") && !Input.GetKey("s"))
	{
		rigidbody.velocity = Vector3(1,0,0) * Speed;
		transform.eulerAngles = Vector3(0,90,0);
	}

From here I am unsure what to do. So any help would be appreciated :D!

You can use Quaternion.RotateTowards() to rotate over time. Here is your script with a RotateTowards() integrated:

#pragma strict

var speed : float = 2.0;
var rotationSpeed : float = 55.0;
var qTo : Quaternion;

function Start() {
	qTo = transform.rotation;
}
 
function Update () 
{
    if(Input.GetKey("w") && !Input.GetKey("a") && !Input.GetKey("d"))
    {
       rigidbody.velocity = Vector3(0,0,1) * speed;
       qTo = Quaternion.Euler(0,0,0);
    }
    if(Input.GetKey("w") && Input.GetKey("a"))
    {
       rigidbody.velocity = Vector3(-1,0,1) * speed;
        qTo = Quaternion.Euler(0,-45,0);
    }
    if(Input.GetKey("w") && Input.GetKey("d"))
    {
       rigidbody.velocity = Vector3(1,0,1) * speed;
        qTo = Quaternion.Euler(0,45,0);
    }
    if(Input.GetKey("s") && !Input.GetKey("a") && !Input.GetKey("d"))
    {
       rigidbody.velocity = Vector3(0,0,-1) * speed;
        qTo = Quaternion.Euler(0,-180,0);
    }
    if(Input.GetKey("s") && Input.GetKey("a"))
    {
       rigidbody.velocity = Vector3(-1,0,-1) * speed;
       qTo = Quaternion.Euler(0,45,0);
    }
    if(Input.GetKey("s") && Input.GetKey("d"))
    {
       rigidbody.velocity = Vector3(1,0,-1) * speed;
        qTo = Quaternion.Euler(0,-45,0);
    }
    if(Input.GetKey("a") && !Input.GetKey("w") && !Input.GetKey("s"))
    {
       rigidbody.velocity = Vector3(-1,0,0) * speed;
        qTo = Quaternion.Euler(0,-90,0);
    }
    if(Input.GetKey("d") && !Input.GetKey("w") && !Input.GetKey("s"))
    {
       rigidbody.velocity = Vector3(1,0,0) * speed;
       qTo = Quaternion.Euler(0,90,0);
    }
    
    transform.rotation = Quaternion.RotateTowards(transform.rotation, qTo, rotationSpeed * Time.deltaTime);
}

As a minor improvement, look at the KeyCode enumeration rather than strings as parameters for your GetKey() calls.