how do I smoothly lerp/Slerp camera rotation during gravity change?

I’ve been making a sonic like game where you can go through loop de loop and using this custom gravity as help its been working well.

Except I didn’t like how the rotation of the camera was so I’ve been trying to augment but I’ve come across a snag where the pitch never properly lerps not matter what I’ve tried, so just hoping someone might possible have the answer because this issue has been driving me up the wall.

Hello @TundraFall ,
Could you show how you’ve implemented the code? I’ve already seen the documentation you shared above on how it’s supposed to be done, but it would be helpful to see your current implementation. That way, it’ll be much easier to identify what might be going wrong and how to properly add the camera rotation.

This is how I’ve got it setup so far, pretty much follows the same as the original but slight changes

FRotator ViewRotation = PlayerCameraManager->GetCameraRotation();
FRotator AugmentedRotation = ViewRotation;

//Gets the Compenstated Rotation
if (!LastFrameGravity.Equals(FVector::DownVector))
{
	const FQuat DeltaGravityRotation = FQuat::FindBetweenNormals(LastFrameGravity, GravityDirection).GetNormalized();
	const FQuat WarpedCameraRotation = DeltaGravityRotation * FQuat(AugmentedRotation);

	AugmentedRotation = WarpedCameraRotation.Rotator();
}
LastFrameGravity = GravityDirection;

//Natural Rotation
ViewRotation = GetGravityRelativeRotation(ViewRotation, GravityDirection);

//Compensated Rotation Gravity 
AugmentedRotation = GetGravityRelativeRotation(AugmentedRotation, GravityDirection);

//float Pitch = FMath::FInterpTo(ViewRotation.Pitch, AugmentedRotation.Pitch, DeltaTime, 100);
	
//DesiredRotation
FRotator IntendedRot = FRotator(AugmentedRotation.Pitch, ViewRotation.Yaw, 0);

//IntendedRot = GetGravityRelativeRotation(IntendedRot, GravityDirection);
FRotator DeltaRot(RotationInput);

if (PlayerCameraManager)
{
	PlayerCameraManager->ProcessViewRotation(DeltaTime, ViewRotation, DeltaRot);

	FQuat CameraRotting = FQuat::Slerp(ViewRotation.Quaternion().GetNormalized(), IntendedRot.Quaternion().GetNormalized(), (DeltaTime*10)).GetNormalized();

	SetControlRotation(GetGravityWorldRotation(CameraRotting.Rotator(), GravityDirection));
}

if (OwnerCharacter)
{
	OwnerCharacter->FaceRotation(ViewRotation, DeltaTime);
}```

Use ViewRotation = Math::RInterpTo(ViewRotation, AugmentedRotation, DeltaTime, Speed);inside your tick.

Please note that the code is not tested as I can’t compile ATM. Here is a BP that can show you, very crudely, how it works:

I hope you can derive the C++ without too much trouble.