Math problem

Care somebody teach me some math.

Is there some kind of solution in trigonometry to solve this. I need to adjust the muzzle towards the ball. Now it takes the orientation from the pivot point. I tried to read something about trigonometry, but all i get was distraction to far away from the problem. This is about angles, right? And if u can explain solution in great detail, i might learn something. I also use blueprints.

Thx.

Just process separately yaw and pitch.
For yaw use pivot of the “cannon” to FindLookAtRotation as you already do.
For pitch, place a socket (or just some dummy object like arrow) at the end of the muzzle. Use position of dummy object to calculate pitch using FindLookAtRotation and use it on rotation of “cannon” pivot.

Wow, it works great. Thank u very much. It is always nice to have smart people to have the best and simple solutions.

Thx again!