I am currently working on the AI for an object which tracks the player in 3D space. What I am trying to achieve involves 2 rotations:
Rotate object to face the player
Rotate object to match player’s rotation along the forward axis
My question is, can the above 2 rotations be achieved in a single call to Quaternion.RotateTowards() or should they happen sequentially? If sequentially, would the order of rotation matter?
What I currently have working only covers facing the player. How can I most efficiently add the 2nd rotation? Any help is appreciated.
Always best to cascade your rotations with separate parented Transforms. Here’s an example using gun turrets, which traverse (left / right) and elevate (up / down).