From an FPS perspective, how would i print the angle of an object I am facing?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Name

I’ve been playing about with some code in an fps type game…
I’m trying to print out the rotation angle of the object I am looking at
as though the object was stood on a clock.

For example:
If I was looking at it from the right side it would print 3 o’clock, or 90…
Behind, 6oclock or 180 etc.

:bust_in_silhouette: Reply From: ra45

This is more of a math problem, but the docs show how you should try right here: Vector math — Godot Engine (stable) documentation in English.
You can use it for angle detection and you could do some if else statements to convert it in clock time. I hope I helped you.

Yeah, I think my problem is
Some in maths but more in the way I’ve been writing the code.

Although I scrapped the code, I was printing… a time,
but was printing the time more in relation from my rotation
to the objects rotation whether I was looking at the object or not.

I know it’s my math and code logic, I can figure out coding a car suspension
But not this haha, three days I’ve spent so far I’ll have a read through
I’m probably just writing it out in the wrong order or something.

Name | 2020-10-25 20:30