When I use Fmath::CInterpTo in the following manner, interpolation stops after a single first frame, and the color never gets close becoming to the target color. Is this expected behavior in the following case? Is there something I can do to make interpolation continue past the first frame?
In AMyHUD.cpp:
// After a three second delay, HUDTimer() calls FadeTransition().
void AMyHUD::HUDTimer()
{
GetWorldTimerManager().SetTimer(AMyHUD::TimerHandle1, this, &AMyHUD::FadeTransition, 3.0f, false);
}
//FadeTransition() is supposed to interpolate the color variable named CurrentTransitionColor from clear to black in 2 seconds. However, the interpolation process prematurely stops after one frame.
void AMyHUD::FadeTransition()
{
CurrentTransitionColor = FMath::CInterpTo(FLinearColor(1.f, 1.f, 1.f, 0.f), FLinearColor(1.f, 1.f, 1.f, 1.f), 2.0f, 1.0f);
}
// DrawHUD() is continually drawing a rectangle over the screen that is the color of the CurrentTransitionColor variable. The rectangle never becomes black like expected, because color interpolation stops early.
void AMyHUD::DrawHUD()
{
Super::DrawHUD()
AMyHUD::DrawRect(CurrentTransitionColor, 0.f, 0.f, Canvas->ClipX, Canvas->ClipY);
}
Is the interpolation expected to stop after just one frame in this case? How could it be continued beyond the first frame? Thanks.