How can I find an FRotator that defines the rotational difference between two FTransforms?

A Rotator is a quaternion format. Try converting to Euler for both rotations and get the difference of those…

I’ve got two FTransforms; let’s say currentTransform and desiredTransform. How can I find an FRotator that defines the pitch, yaw & roll difference between the two?

Thanks in advance!

I should clarify, simply calling desiredTransform.GetRotation() - currentTransform.GetRotation() does not give me the results I want.

this worked just about as well as subtracting FRotator values directly. still get weird results when my actor’s rotation hits the 180 degree mark. this method does not seem to handle that boundary between negative and positive rotation values.

 FRotator rotationDelta = FRotator::MakeFromEuler(desiredTransform.GetRotation().Euler() - GetTransform().GetRotation().Euler());
 
 AddControllerPitchInput(rotationDelta.Pitch);
 AddControllerYawInput(rotationDelta.Yaw);
 AddControllerRollInput(rotationDelta.Roll);

There is a function to get delta rotation from 2 rotators:

FRotator UKismetMathLibrary::NormalizedDeltaRotator(FRotator A, FRotator B)
{
	FRotator Delta = A - B;
	Delta.Normalize();
	return Delta;
}

Maybe You need to normalize rotationDelta rotator.

THANKS SO MUCH Pierdek! that’s exactly what i was looking for. i feel dumb O_o

Can I convert my comment as answer?:slight_smile: