diff --git a/Source/KO_Racing/MyRaceUserWidget.cpp b/Source/KO_Racing/MyRaceUserWidget.cpp index 6df3427..74ad8bf 100644 --- a/Source/KO_Racing/MyRaceUserWidget.cpp +++ b/Source/KO_Racing/MyRaceUserWidget.cpp @@ -41,7 +41,7 @@ void UMyRaceUserWidget::ChangeSpeedValue(float value) void UMyRaceUserWidget::StartTimer() { _timer = 0; - _beforeStart = 4; + _beforeStart = 3; _timerIsStarted = true; } @@ -70,9 +70,11 @@ void UMyRaceUserWidget::UpdateTimer(float deltaTime) _timerTxt->SetText(FText::FromString(GenTimerFString(_timer))); } else { _beforeStart -= deltaTime; - _beforeStartTimerTxt->ChangeValue(_beforeStart); - if (_beforeStart <= 0) + _beforeStartTimerTxt->ChangeValue(_beforeStart + 1); + if (_beforeStart <= 0) { _raceAsStarted = true; + _beforeStartTimerTxt->SetVisibility(ESlateVisibility::Hidden); + } } } } diff --git a/Source/KO_Racing/MyRaceUserWidget.h b/Source/KO_Racing/MyRaceUserWidget.h index 24a79a5..20213f9 100644 --- a/Source/KO_Racing/MyRaceUserWidget.h +++ b/Source/KO_Racing/MyRaceUserWidget.h @@ -70,7 +70,7 @@ class KO_RACING_API UMyRaceUserWidget : public UUserWidget static std::string GenTimerString(float time); float _timer = 0; - float _beforeStart = 4; + float _beforeStart = 3; bool _timerIsStarted = false; TArray _lapTime; float _lastLapTimer = 0;