Pretty self explanatory. This class code compiles fine. It lets me create a child blueprint. Let’s me put that in the world, just like it’s suppose to. But if I try to actually edit the child blueprint or PIE, insta-crash.
Atmosphere.h
UCLASS()
class MYSAGA_API AAtmosphere : public AActor
{
GENERATED_BODY()
public:
/* Methods created by the engine. Basic functionality. DO NOT DELETE WITHOUT COMMENTING WHY*/
AAtmosphere();
virtual void BeginPlay() override;
virtual void Tick( float DeltaSeconds ) override;
//private:
/* These are the primary components of the Atmosphere class
* They are initialized in the constructor before beginning play */
UPROPERTY(BlueprintReadOnly) UDirectionalLightComponent* WorldLight = nullptr;
UPROPERTY(BlueprintReadOnly) UAtmosphericFogComponent* AtmosphereFog = nullptr;
UPROPERTY(BlueprintReadOnly) UExponentialHeightFogComponent* HeightFog = nullptr;
UPROPERTY(BlueprintReadOnly) AAmbientSound* AmbientSound = nullptr;
};
Atmosphere.cpp
// Sets default values
AAtmosphere::AAtmosphere()
{
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = false;
// Attaches all appropriate components for creating and controlling the game atmosphere.
UDirectionalLightComponent* WorldLight = CreateDefaultSubobject<UDirectionalLightComponent>(FName(TEXT("World Light")));
UAtmosphericFogComponent* AtmosphereFog = CreateDefaultSubobject<UAtmosphericFogComponent>(FName(TEXT("Atmosphere Fog")));
UExponentialHeightFogComponent* HeightFog = CreateDefaultSubobject<UExponentialHeightFogComponent>(FName(TEXT("Height Fog")));
AAmbientSound* AmbientSound = CreateDefaultSubobject<AAmbientSound>(FName(TEXT("Ambient Sound")));
}
Again, this compiles, and I can successfully put a blueprint of this class into my world… It just won’t let me open the blueprint or run the world…