I am trying to make on screen instructions with the hud based on a certain level in c++. Currently I am checking which level I am on which determines what the hud will display. However, I only want the text to appear on the screen for x amount of seconds.
In MyHud.cpp
//Get the screen dimensions
FVector2D ScreenDimensions = FVector2D(Canvas->SizeX, Canvas->SizeY);
//Call to the parent versions of DrawHUD
Super::DrawHUD();
if (GetWorld()->GetMapName() == TEXT("UEDPIE_0_Office"))
{
FVector2D StringSize;
GetTextSize(TEXT("Use W A S D to move around"), StringSize.X, StringSize.Y, HudFont);
DrawText(TEXT("Use W A S D to move around"), FColor::White, 50, 50, HudFont);
}
However this will obviously have the text appear on the screen until the game changes levels. How can I make only display for a few seconds before moving onto the next text or displaying nothing?