Scenario:
- Parent P1 has Child C1
- Target exists
- All items' forward vectors face perfectly parallel to the X-Z Plane (pseudo 2D)
- Positions of all objects are arbitrary
- Child will never move on its own within Parent's space
Goal:
Rotate P1 exclusively about the Y-Axis to have C1 Face the opposite direction of target's forward vector
Note: Y-Axis Positive would face reader, Negative would go into screen
Implementation:
P1.rotation = Quaternion.LookRotation(-target.forward) * Quaternion.Euler(0, -C1.localEulerAngles.y, 0);
The above seems to work most of the time but breaks randomly and sometimes generates a Zero Vector as the forward. I am inexperienced with Euler Angles and Quaternions so my apologies in advance.