diff --git a/Unreal/Plugins/AirSim/Source/SimMode/SimModeWorldBase.cpp b/Unreal/Plugins/AirSim/Source/SimMode/SimModeWorldBase.cpp index 4c44a3c3cd..d3c96e5df7 100644 --- a/Unreal/Plugins/AirSim/Source/SimMode/SimModeWorldBase.cpp +++ b/Unreal/Plugins/AirSim/Source/SimMode/SimModeWorldBase.cpp @@ -84,7 +84,18 @@ void ASimModeWorldBase::pause(bool is_paused) void ASimModeWorldBase::continueForTime(double seconds) { + if(physics_world_->isPaused()) + { + physics_world_->pause(false); + UGameplayStatics::SetGamePaused(this->GetWorld(), false); + } + physics_world_->continueForTime(seconds); + while(!physics_world_->isPaused()) + { + continue; + } + UGameplayStatics::SetGamePaused(this->GetWorld(), true); } void ASimModeWorldBase::updateDebugReport(msr::airlib::StateReporterWrapper& debug_reporter)