Download

Math problem.

Care somebody teach me some math.

AngleProblemo.jpg

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.

48f49e6a5c2f61ef9bb2827ad43cecf15b2322be.jpeg

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!