How to rotate the character in the direction they are moving?

Hi! I’m sure there’s some post online already of how to do this, but I couldn’t find anything.
I have a character with a character controller who can only move in 4 directions. I have made it so that when he is moving in one of those directions, he will rotate to face the way he is going. The only issue is that he will just cut to the desired rotation, rather than smoothly going in that direction.
Thank you!

void FixedUpdate()
    {
        if (Input.GetKey(KeyLeft))
        {
            //Rotates the player in the direction they are moving
            //Moves the character controller
            if (InWater == false)
            {
                transform.rotation = Quaternion.Euler(0, 90, 0);
                Vector3 move = new Vector3(1, 0, 0);
                Controller.Move(move * Time.deltaTime * Speedy);
                //Speedy is the float for speed. I had already used Speed, and Speedy worked fine :P
                //This just cuts to the desired rotation, how can i have it go smoothly?
            }
1 Like