0 votes

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!

in Engine by (26 points)

1 Answer

+1 vote
Best answer

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/

by (7,890 points)
selected by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.