diff --git a/Source/Unrealzilla/Private/BugPlacerPawn.cpp b/Source/Unrealzilla/Private/BugPlacerPawn.cpp index 54c19ef..51a5ff6 100644 --- a/Source/Unrealzilla/Private/BugPlacerPawn.cpp +++ b/Source/Unrealzilla/Private/BugPlacerPawn.cpp @@ -162,13 +162,18 @@ void ABugPlacerPawn::Activate() UGameplayStatics::GetPlayerController(this, 0)->Possess(this); - float TraceInterval = this->GetActorTickInterval() > 0.0f ? this->GetActorTickInterval() : 1.0f / 60.0f; + const float &MinTimeDilation = this->GetWorldSettings()->MinGlobalTimeDilation; + this->GetWorldSettings()->SetTimeDilation(MinTimeDilation); + this->CustomTimeDilation = 1.0 / MinTimeDilation; + + float TraceInterval = this->GetActorTickInterval() > 0.0f ? this->GetActorTickInterval() : (1.0f / 60.0f) * MinTimeDilation; this->GetWorldTimerManager().SetTimer(this->TraceTimerHandle, this, &ABugPlacerPawn::TraceTimerElapsed, TraceInterval, true); } void ABugPlacerPawn::Deactivate() { this->GetWorldTimerManager().ClearAllTimersForObject(this); + this->GetWorldSettings()->SetTimeDilation(1.0f); UGameplayStatics::GetPlayerController(this, 0)->Possess(this->OriginalPlayer);