From 2b2a2a1b83c77dbe75c8fc92c4bc3694cc032d54 Mon Sep 17 00:00:00 2001 From: Blyron <53337103+Blyron@users.noreply.github.com> Date: Wed, 6 Nov 2024 15:25:27 +0100 Subject: [PATCH] Apply fix for Sensor as Marcel implemented (#8344) --- .../Carla/Source/Carla/Sensor/SceneCaptureSensor.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Sensor/SceneCaptureSensor.cpp b/Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Sensor/SceneCaptureSensor.cpp index a5f1e1f70..8c4e8164f 100644 --- a/Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Sensor/SceneCaptureSensor.cpp +++ b/Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Sensor/SceneCaptureSensor.cpp @@ -710,10 +710,12 @@ void ASceneCaptureSensor::BeginPlay() UpdatePostProcessConfig(PostProcessConfig); CaptureComponent2D->ShowFlags = PostProcessConfig.EngineShowFlags; CaptureComponent2D->PostProcessSettings = PostProcessConfig.PostProcessSettings; - + // This ensures the camera is always spawning the raindrops in case the // weather was previously set to have rain. - GetEpisode().GetWeather()->NotifyWeather(this); + auto Weather = GetEpisode().GetWeather(); + if (Weather != nullptr) + Weather->NotifyWeather(this); Super::BeginPlay(); }