0 votes

I'm trying to calculate the angle between my characters Z axis and the cameras Z axis. How would I go about doing this, and does Godot have any build in methods to make it any easier?

in Engine by (273 points)

EDIT: For Vector2 is angle_to, but z axis?

If is for Vector3, just checked and Vector3.angle_to is on Godot 2.1.1

It appears on internal editor's docs (with no details) but are not on the website yet.

Reminder: in Godot, the Camera's Z axis is backwards due to OpenGL convention.
I would go for eons solution once you have the two vectors.
And indeed... the function exists https://github.com/godotengine/godot/blob/master/core/variant_call.cpp#L1493
But it's not in the docs :|

Please log in or register to answer this question.

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 Frequently asked questions and 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 [email protected] with your username.