How can I resolve an editor crash after second BluePrint Compile?

When I load the Editor, with my Custom AActor Class, everything works fine. If I edit my BluePrint (based on this Class) by first time, its ok. But no mater what I Do, at the second try to compile, the editors crash.

Please tell me I´m doing something wrong for quick fix, because this is absolutely insupportable.

Here my Code:

Weather.h

// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.

#pragma once

#include "GameFramework/Actor.h"
#include "Weather.generated.h"

/**
 *
 */
UCLASS(Blueprintable)
class AWeather : public AActor
{
	GENERATED_UCLASS_BODY()

	/** Sun */
	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Weather")
		TSubobjectPtr<class UDirectionalLightComponent> Sun;

	/** BaseSpeed */
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Weather")
		float BaseSpeed;
	
	/** SunAngle */
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Weather")
		float SunAngle;

	/** SunDirection */
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Weather")
		float SunDirection;

	/** SunInclination */
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Weather")
		float SunInclination;

	UFUNCTION(BlueprintImplementableEvent, Category = "Weather")
		void CallDawn();

	UFUNCTION(BlueprintImplementableEvent, Category = "Weather")
		void CallDay();

	UFUNCTION(BlueprintImplementableEvent, Category = "Weather")
		void CallMidDay();

	UFUNCTION(BlueprintImplementableEvent, Category = "Weather")
		void CallDusk();

	UFUNCTION(BlueprintImplementableEvent, Category = "Weather")
		void CallNight();

	UFUNCTION(BlueprintImplementableEvent, Category = "Weather")
		void CallMidNight();

	UFUNCTION(BlueprintImplementableEvent, Category = "Weather")
		void CallUpdateTimeOfDay();


	void DefineTimeOfDay();
	void Tick(float DeltaTime) OVERRIDE;
	void OnConstruction(const FTransform& Transform) OVERRIDE;

	float _MaxAngle;
	float _SunAngleStart;
	int32 _lastAngle;
	FString _lastTimeOfDay;


};

Weather.cpp

// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.

#include "Sky.h"
#include "Weather.h"


AWeather::AWeather(const class FPostConstructInitializeProperties& PCIP)
: Super(PCIP)
{

	this->BaseSpeed = 15;
	this->SunAngle = 0;
	this->_MaxAngle = 360;
	this->_SunAngleStart = -90;
	this->Sun = PCIP.CreateDefaultSubobject<UDirectionalLightComponent>(this, TEXT("DirectionalLightComponent"));
}

void AWeather::Tick(float DeltaTime)
{
	Super::Tick(DeltaTime);

	this->SunAngle = this->SunAngle + (DeltaTime * this->BaseSpeed);

	FRotator Rotator = FRotator::ZeroRotator;
	Rotator.Add(this->SunAngle - this->_SunAngleStart, this->SunDirection, this->SunInclination);

	this->Sun->SetWorldRotation(Rotator);

	if (this->SunAngle >= 360)
	{
		this->SunAngle = 0;
	}

	if (_lastAngle != floor(this->SunAngle)) {
		CallUpdateTimeOfDay();
		_lastAngle = floor(this->SunAngle);
	}

	DefineTimeOfDay();
}

void AWeather::DefineTimeOfDay()
{
	if (SunAngle >= 0 && SunAngle < 75 && _lastTimeOfDay != "midnight")
	{
			CallMidNight();
			_lastTimeOfDay = "midnight";
	}
	else if (SunAngle >= 75 && SunAngle < 90 && _lastTimeOfDay != "dawn")
	{
		CallDawn();
		_lastTimeOfDay = "dawn";
	}
	else if (SunAngle >= 90 && SunAngle < 180 && _lastTimeOfDay != "day")
	{
		CallDay();
		_lastTimeOfDay = "day";
	}
	else if (SunAngle >= 180 && SunAngle < 255 && _lastTimeOfDay != "midday")
	{
		CallMidDay();
		_lastTimeOfDay = "midday";
	}
	else if (SunAngle >= 255 && SunAngle < 270 && _lastTimeOfDay != "dusk")
	{
		CallDusk();
		_lastTimeOfDay = "dusk";
	}
	else if (SunAngle >= 270 && SunAngle < 360 && _lastTimeOfDay != "night")
	{
		CallNight();
		_lastTimeOfDay = "night";
	}
}

void AWeather::OnConstruction(const FTransform& Transform)
{
	Super::OnConstruction(Transform);

	PrimaryActorTick.bCanEverTick = true;
	Sun->SetRelativeScale3D(FVector(2.5f, 2.5f, 2.5f));
	RootComponent = Sun;
	FRotator Rotator = FRotator::ZeroRotator;
	Rotator.Add(this->SunAngle - this->_SunAngleStart, this->SunDirection, this->SunInclination);
	this->Sun->SetWorldRotation(Rotator);
	
}

When you says the editor crash Do you lunch the game from your coding IDE or you load directly the game from the editor ? Also i wanna know where your game crash. Can you give me the errors he’s throw.

Do you have tried to place breakpoint and go in debug mode ?

I need little more details to help.

The editor Crashes on Compile a BluePrint. The message is “Sorry for this bla bla bla”.

Thanks, I Know the use of breakpoints. But they will fire at compile of a BluePrint?

Ok. as i said did you try to go in debug mode add add breakpoints to follow step by step to see where it’s crash ?

Are you on MAC or Windows ?

I don’t know if you know what is a debugger or breakpoints

Try to run your game in DebugGame Editor Top of visual studio → Solutions Configurations → select DebugGame Editor

Place breakpoints at key places to follow step by step.

Dou you know how to use BreakPoints ?

this could help link text

If i know in wich class and when it crash i could help.

Yes because it’s a custom class so if you put your game in debug mode in Visual studio in put breakpoint it will fire.

Also if you have custom management in blueprint graph, you can put break pointdirectly on the blueprint in the editor to see variables and data to see the process.

Jest follow step by step and says me where and when it crash. i will help you.

Ok i will come back to see what happened

Thanks again. I Will debug at night, and come back here to give more details.

On 4.2 the problem solved.