simple rotation in angles?

situation:

  • I have a player at position (0,0,0)
  • I have a cube at position (5,5,5)
  • I have a sphere at position (-5,-5,-5)

I use LookAt to make player look at cube and then the sphere.

How do I extract the difference between the two rotations, I need to extract the float angles in 2 steps from the point when it’s looking at the cube (step 1: turn horizontal around Y axis first. And step 2: turn vertical around Z axis second)

I need these 2 values for use in another script

Can you not just get the rotations before and after, and then subtract them?

not sure, rotations work with x and y and z and I need the values of the angles in 2 directions only, a spin horizonal and a flip up/down.

(ps: the 5,5,5 is only an example, it can be 1,2,3 or 20,50,80)