Here is the process the system goes through-
-
Get’s A’s postion, A being an object above me, and it does the same for B, B being the local player.
~ This is a single player subroom. -
Get’s a direction that points from A to B by subtracting A’s position from B’s position and then normalizing the difference.
-
Splits the direction into two vector, being the direction’s X and Z, as the first vector, to get “Forward” and the direction’s Y, as the second Vector, to get “Upwards”.
-
Uses the “Forward” and “Upwards” to create a quaternion through “Quaternion Create Look”.
-
Puts the quaternion into “Quaternion Euler Angles” to get the pitch, yaw, and roll in degrees by creating a vector.
-
Splits the vector to get only the yaw, as yaw is the only one I need.
The system is shown below.
I apoligize for how poor the screenshots came out.
If you look at the pictures, you may see that I am hovering over the outputs for “Quaternion Create Look” and "Quaternion Euler Angles. Directions use pitch yaw pitch and euler angles use pitch yaw roll. You don’t really need to know this but it helps to understand the next part.
When the quaternion is turned into a euler angle, the only rotation that is correct is the yaw. The pitch rotation is always 0º and the roll rotation is always 180º. If I switch the “Foward” and "Upward ports, the pitch changes to 90º and the roll to 0º.
Thankfully, I only need the yaw roation, but I would still like to know what is or may be going on.