I am taking an example from a diffrent project and re-creating it in my own game. In the original working project, there is a gun that rotates around the hand correctly and these are some of the correct rotation values:

```
P=0.000000 Y=-48.702690 R=-8.323224
P=0.000000 Y=-49.789928 R=-8.552868
P=-0.000007 Y=-50.883415 R=-8.711617
P=-0.000007 Y=-52.022709 R=-8.827152
P=-0.000007 Y=-53.098286 R=-8.840174
P=0.000000 Y=-54.122597 R=-8.782237
P=0.000000 Y=-55.130390 R=-8.710796
P=0.000000 Y=-56.111393 R=-8.561297
P=0.000007 Y=-57.071911 R=-8.353694
P=0.000000 Y=-58.066284 R=-8.080949
P=0.000007 Y=-58.996971 R=-7.765880
P=0.000000 Y=-60.021267 R=-7.374957
P=0.000000 Y=-61.099659 R=-6.955542
P=0.000000 Y=-62.155025 R=-6.534186
P=-0.000007 Y=-63.222946 R=-6.109061
P=-0.000007 Y=-64.318413 R=-5.663557
P=-0.000007 Y=-65.328362 R=-5.252420
P=-0.000007 Y=-66.379761 R=-4.831179
P=-0.000007 Y=-67.402679 R=-4.408598
P=0.000000 Y=-68.367493 R=-4.024447
```

In my own project, I print out the same rotation values the same way its done in the example but the results look like this and produce an **incorrect** rotation:

```
P=7.775964 Y=-7.446252 R=-0.000001
P=7.824084 Y=-7.487617 R=-0.000001
P=7.818578 Y=-7.518079 R=-0.000001
P=7.850033 Y=-7.517104 R=-0.000001
P=7.858570 Y=-7.491702 R=-0.000001
P=7.864113 Y=-7.506747 R=-0.000001
P=7.866255 Y=-7.553430 R=-0.000001
P=7.897817 Y=-7.592583 R=-0.000001
P=7.916775 Y=-7.657037 R=-0.000001
P=7.922338 Y=-7.749585 R=-0.000001
P=7.989968 Y=-7.808784 R=-0.000001
P=8.000801 Y=-7.914917 R=-0.000001
P=7.993641 Y=-7.998132 R=-0.000001
P=7.993693 Y=-8.040081 R=-0.000001
P=7.861572 Y=-8.544514 R=-0.000001
P=7.832154 Y=-8.645342 R=-0.000001
P=7.791457 Y=-8.710664 R=-0.000001
P=7.802832 Y=-8.731378 R=-0.000001
P=7.763756 Y=-8.795066 R=-0.000002
P=7.734653 Y=-8.790546 R=-0.000001
P=7.715140 Y=-8.758606 R=-0.000001
P=7.686746 Y=-8.767592 R=-0.000001
P=7.592921 Y=-8.746538 R=-0.000001
P=7.560185 Y=-8.724867 R=-0.000001
P=7.504443 Y=-8.743661 R=-0.000001
P=7.429923 Y=-8.720572 R=-0.000001
P=7.396094 Y=-8.722472 R=-0.000001
P=7.371034 Y=-8.729496 R=-0.000001
P=7.331400 Y=-8.721493 R=-0.000001
P=7.353291 Y=-8.695507 R=-0.000001
P=7.358566 Y=-8.671263 R=-0.000001
P=7.356328 Y=-8.624143 R=-0.000001
P=7.369827 Y=-8.545854 R=-0.000001
P=7.372361 Y=-8.504041 R=-0.000001
```

As you can see, it looks like something is slightly off with the math. I first tried to simply switch the pitch and the roll but that didn’t really help too much. I think the answer might be in using UKismetMathLibrary::ComposeRotators() to combine the rotation by 90 somewhere or rotate the rotator?

Edit: Here is the code used to calculate the rotation for the gun when the second hand grabs it (second hand is not attached but the first one is attached).

```
void ATwoHandGunWeapon::Tick(float deltaTime)
{
FVector handleLocalPos;
FVector gripLocalPos;
FRotator gunLookAtRotation;
Super::Tick(deltaTime);
//IF the grip is being touched aswell, account for the rotation.
if (mySecondaryHand != NULL && myGripComponent != NULL && myFirePointComponent != NULL && myRootComponent != NULL)
{
handleLocalPos = UKismetMathLibrary::InverseTransformLocation(this->GetActorTransform(), myPrimaryHand->GetControllerLocation());
gripLocalPos = UKismetMathLibrary::InverseTransformLocation(this->GetActorTransform(), mySecondaryHand->GetControllerLocation());
gunLookAtRotation = UKismetMathLibrary::FindLookAtRotation(handleLocalPos, gripLocalPos);
//Combines two rotators together.
//gunLookAtRotation = UKismetMathLibrary::ComposeRotators(FRotator(0.0f, 0.0f, -90.0f), gunLookAtRotation);
UE_LOG(LogTemp, Error, TEXT("after compose gunLookAtRotation:%s"), *(gunLookAtRotation.ToString()));
myRootComponent->SetRelativeRotation(gunLookAtRotation);
}
}
```