diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaEngine.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaEngine.cpp index 8137b2dbe..d6ce0f353 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaEngine.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaEngine.cpp @@ -91,6 +91,14 @@ void FCarlaEngine::NotifyBeginEpisode(UCarlaEpisode &Episode) Episode.EpisodeSettings.FixedDeltaSeconds = FCarlaEngine_GetFixedDeltaSeconds(); CurrentEpisode = &Episode; + // Reset map settings + UWorld* World = CurrentEpisode->GetWorld(); + ALargeMapManager* LargeMapManager = UCarlaStatics::GetLargeMapManager(World); + if (LargeMapManager) + { + CurrentSettings.TileStreamingDistance = LargeMapManager->GetLayerStreamingDistance(); + CurrentSettings.ActorActiveDistance = LargeMapManager->GetActorStreamingDistance(); + } CurrentEpisode->ApplySettings(CurrentSettings); ResetFrameCounter();