diff --git a/Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Weather/Sky.cpp b/Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Weather/Sky.cpp index 0614d7a87..0e54ec41a 100644 --- a/Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Weather/Sky.cpp +++ b/Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Weather/Sky.cpp @@ -10,20 +10,27 @@ ASkyBase::ASkyBase( const FObjectInitializer& ObjectInitializer) : - Super(ObjectInitializer), - PostProcessComponent(nullptr), - ExponentialHeightFogComponent(nullptr), - DirectionalLightComponentSun(nullptr), - DirectionalLightComponentMoon(nullptr), - SkyLightComponent(nullptr), - VolumetricCloudComponent(nullptr), - SkyAtmosphereComponent(nullptr) + Super(ObjectInitializer) { PostProcessComponent = CreateDefaultSubobject("PostProcessComponent"); + RootComponent = PostProcessComponent; + ExponentialHeightFogComponent = CreateDefaultSubobject("ExponentialHeightFogComponent"); + ExponentialHeightFogComponent->SetupAttachment(RootComponent); + DirectionalLightComponentSun = CreateDefaultSubobject("DirectionalLightComponentSun"); + DirectionalLightComponentSun->SetupAttachment(RootComponent); + DirectionalLightComponentMoon = CreateDefaultSubobject("DirectionalLightComponentMoon"); + DirectionalLightComponentMoon->SetupAttachment(RootComponent); + SkyLightComponent = CreateDefaultSubobject("SkyLightComponent"); + SkyLightComponent->SetupAttachment(RootComponent); + VolumetricCloudComponent = CreateDefaultSubobject("VolumetricCloudComponent"); + VolumetricCloudComponent->SetupAttachment(RootComponent); + SkyAtmosphereComponent = CreateDefaultSubobject("SkyAtmosphereComponent"); + SkyAtmosphereComponent->SetupAttachment(RootComponent); + }