Several ways to go about this. Sometimes I may want rotation to be interpolated with an ease in and ease out. For that I would use
const FRotator resultRotation = FMath::RInterpTo( CurrentRotation, TargetRotation, DeltaTime, RotSpeed );
There is a version that interpolates rotation at a constant speed, didn’t test it yet but it would look very similar:
const FRotator resultRotation = FMath::RInterpConstantTo( CurrentRotation, TargetRotation, DeltaTime, RotSpeed );
In both these functions, **CurrentRotation **is as the name implies… your current rotation. TargetRotation is the final rotation you want to reach (Not the increment). DeltaTime would be passed from your Tick function. And RotSpeed is a scalar that multiplies the incremental rotation the function does.
I havn’t used this myself, but perhaps a more elegant solution to spinning an actor is by using the RotatingMovementComponent
Simply add this component to your pawn and it should spin it automatically based on the speed and offset you provide.
Also, can you try this and let me know if it does anything:
APawn* pawn = AIOwner->GetPawn();
FQuat quat(pawn->GetActorUpVector(), FMath::DegreesToRadians(deg));
I might be getting my quaternion logic wrong here, but the idea is to create a quaternion that rotates about an axis ( I chose the up vector of the actor to spin it about its yaw) with a given amount in radians. Add to your pawn’s rotation every tick and see if that works.