My characters is not controlled by mouse/keyboard. Only pitch-yaw from blueprint sources.
I have a weapon actor socketed into my character mesh.
Forward vector (direction) of my weapon slightly differ from character direction.
I have an AIM Offset, but only for Y vector (strictly vertical), and use yaw value to turn a whole character to aiming point.
And here i have a big problem.
I cant make my actor to rotate to weapon aim point.
I tried to make double traces: first was char to target point trace, rotate for it, and then make another trace to get vector between weapon hit and target point hit, and then reajust my char rotation to the new one(vector minus vector: weaponHit - targetPoint).
It worked, but i think is not a good solution to make double rotations.
And even when yaw rotation is correct, i cant make proper PITCH rotation.
If i will change height of my target, my ptich rotation does wrong.
Because of weapon socket isn’t center of my character.
I have ticking rotations, with RotationPoint (on my screens) is location of target.
But when i try to adjust rotation of my char by those methods, it does infinite circles.
So i have to ask, how can i adjust my yaw and pitch actor rotation with differ weapon fwd and up vectors so my weapon look direct to target point ?
Both screens below didnt work. And i dont know why. First one just rotate to wrong direction, second one just does infinite roatate of my char around himself.
Pls sorry for my bad language.