How to smoothly rotate a Spatial by 45 degrees?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By saladass
:warning: Old Version Published before Godot 3 was released.

Hello. Please, help me. How to smoothly rotate a Spatial by 45 degrees Y axis with a single press of a key? I’m trying to make a camera like in this video:
http://youtu.be/imUXa_FF7l8?t=10s

Thank you in advance!

:bust_in_silhouette: Reply From: eons

On a project I have used a Spatial as pivot following the target and a camera (child) looking at it, then I just rotate the pivot when I need, the result was similar to the SmoothFollow script of Unity but just with nearly zero code.

But I think the best option could be to use spherical interpolation and quaternions to avoid problems.

Check this Codetuto post about 3D rotation basics in Godot
http://codetuto.com/2016/01/godot-engine-movement-and-rotation-basics/