Imagine it as a stick on gamepad. It can lean towards needed direction without twisting it - only by affecting X and Z axis. I have a transform with 0 0 0 rotation, then i need it to lean 15 degrees towards another transform which can be anywhere in relation to original transform, but on the same Y position (altitude). How can i make original transform lean towards target transform?
You could use RotateAround: Unity - Scripting API: Transform.RotateAround
Pick your pivot point, then the axis would be something like Vector3.Cross(Vector3.up, Vector3.ProjectOnPlane(Vector3.up, leanTowards.position - transform.position))
In english that’s the cross product of global up and the direction from your object to the target object (projected on the XZ plane)
Thanks again