I have a base turret actor, it has a turret component, I want it rotate in Yaw to target no matter the rotation of owner what is it.
FRotator TheAimingRotation = UKismetMathLibrary::FindLookAtRotation(GetOwner()->GetActorLocation(), TargetLocation);
// I tired multiplied pitch yaw and roll with a different combination of Owner UpVector and using SetWorldRotation but it doesn't work every time one angle show the inverse rotation to me.
NewRotation = FRotator(0 , TheAimingRotation.Yaw+GetOwner()->GetActorRotation().Yaw ,0);
SetRelativeRotation(NewRotation);
FindLookAt doesn’t work correctly cause it seems don’t consider vectors of Owner . in Fvector(0,0,0) its work but when owner forward vector and up Vector get minus its work inverse.
my guess solution of this is using FRotationMatrix but I don’t know how ?!
if there is any solution for this plz let me know?
please someone help me…
Thanks.
Actor in 0 , 0 , 0 rotation :
Actor in -180 , 0 , -180 :