how to smoothly rotate the character controller by 45 Degrees using the keyboard arrow keys?

in the same way as LEGO Star Wars The Quest for R2D2 game using the keyboard arrow keys

there is not an special way for character controllers but you can rotate a transform smoothly easily. you should use coroutines for this.

C# code

IEnumerator RotateSmoothly(float deg)
{
float current; //object will rotate in this ammount in each frame
float rotated=0
while (rotated < deg)
{
current=30*time.deltaTime; //30 degrees per second
if (rotated+current>deg) current-=deg-rotated; //clamping
transform.rotate (current,0,0);
yield return 0; //wait one frame and execute the loop again
}
}

the code is written here and is not tested but it can take you the idea of doing things like this. this code works for values greater than zero but you can easily modify it to work with values less than zero.