Custom Pawn Turn rate is too fast

Alright, so I’m trying to make a pawn character that turns slower the faster you’re going. For my control scheme I consider the direction the player inputs is the way they want to go, so say that you want to go southwest and the character is going north you would press the controls southwest and wait for your character to turn to match.

The problem: is that my pawn seems to be rotating WAY TOO FAST, to the point that it could just be doing random rotations and is practically a blur.

Here is the code that “throttles” the difference in direction to my max turning speed:

if (!TurningAmount.IsNearlyZero())
		{
			

			if (abs(TurningAmount.Yaw) <= 90)
			{
				NewRotation.Yaw += .0001 * (TurningAmount.Yaw / 90);
			}
			else
			{
				NewRotation.Yaw += .0001 * (1 - ((TurningAmount.Yaw - 90) / 90));
			}

			/*
			FString Result = FString::SanitizeFloat(NewRotation);
			GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Yellow, Result);
			*/

			NewVelocity = NewRotation.RotateVector(NewVelocity);
		}

For clarity, TurningAmount is a FRotator set to represent the angle difference between the direction I want to go and the direction my pawn is currently going. It ranges for -180 to -180 with 0 being no difference in direction. I want it so my pawn rotates the fastest when the angle difference is a right angle or “90”.

I haven’t set up my turning speed value yet cause I wanted to get the code working on a normal level first. For now I’ve been representing that as the .0001. It was originally a 1 but I tried making it smaller thinking I had just set the code to rotate too fast.

OH, and I almost forgot: the code above is in my tick function and “should” be already controlled by delta seconds. I’ve been coding this in stages and it’s worked perfectly until I added this rotation code.

Thank you for any and all help.

Bit of an update: I’ve managed to stop it from spinning like a top by normalizing a lot of the rotations I’m using, but I still have a problem.

At first when I run the game it seems to work fine, but after a few moments the pawn “hitches” on something and then it starts sort of vibrating and goes in the wrong direction.

I’m genuinely stumped by this.

Ok, I finally got fed up and just rewrote the code from scratch.

if (!TurningAmount.IsNearlyZero())
		{
			if (abs(TurningAmount.Yaw) <= 90)
			{
				NewRotation.Yaw = TurningAmount.Yaw;
			}
			else
			{
				NewRotation.Yaw = 180 - TurningAmount.Yaw;
			}

			NewRotation.Normalize();
			NewRotation.Yaw /= 90;

			NewVelocity = NewRotation.RotateVector(NewVelocity);
		}

Basically I was forced to move my math out of the if/else statement and have that focus on just figuring out how much my controller is turning.

Hope someone learns from this, cause I’m not sure if I have…