I have situation. I want smoothly change FOV while moving forward. In Camera settings in parent class I set default value:
FollowCamera->FieldOfView = 90.0f;
Then in MoveForward function do this.
//Angle of direction of camera on Yaw
const FRotator Rotation = Controller->GetControlRotation();
const FRotator YawRotation(0, Rotation.Yaw, 0);
const FVector Direction = FRotationMatrix(YawRotation).GetUnitAxis(EAxis::X);
AddMovementInput(Direction, Axis);
FollowCamera->FieldOfView = 140.0f;
}
Actually it works, so when I move forward FOV changes to 140, but it works really roughly and instantly. I want to do it smoothly from 90 to 140. Can you help me with it?