How do I orient one axis of an object following LookAt/LookRotation?
I currently have two basic objects, with one looking at the other. The player can drag these around in full 3D space. This is done with LookRotation
and works well.
Following this rotation, I would also like to orient the object's facing direction. How can I do this without overriding the initial LookRotation
?
The yellow gizmos represent each cubes facing direction, and the green gizmo shows the direction I am trying to get the tracking cube to face. This direction aligns with the 30 degree offset of the target cube.
The solution intends to be used in cases where both objects aren't necessarily aligned with any global axis. Unfortunately, I have struggled to achieve the desired effect even in my controlled testing where the Y-axis in the known pivot point.
Your answer
Follow this Question
Related Questions
Trying to MathF.Clamp y axis rotation results in x equal 270 and y equal max value instantly 1 Answer
Delayed LookAt, but only on one axis 1 Answer
How to use Quaternion.slerp and Quaternion.LookRotation with a child gameobject 0 Answers
How do I rotate y to mouse location with the x rotation staying set? 0 Answers
Mobile Gyroscope, make Camera always rotating towards zero point using Quaternion 2 Answers