The problem with this is as soon as I leave the direction key, it does not return to original state and stays at the same angle. Can any suggest any changes in the code to do the same?
It might be the case where the input value changes to rapidly, and you want it to look smoother. Then you could ease the value using the Lerp function.