Compiling project crashes editor

I have a boilerplated class, a subclass of Character class and I have added two UPROPERTY statements to it. However, it is causing my editor to crash. What is happening is that if I keep the two ‘UPROPERTY’ statements in code, and hit compile in UE Editor, the editor crashes. Now it won’t load the project again, and would crash every time after 70% loading is done. I’ve searched the forums, but haven’t found a solution. I am using 4.7.6. Please help!

#pragma once

#include "GameFramework/Character.h"
#include ".generated.h"

UCLASS()
class GOLDENCOOKIE_API ANPC : public ACharacter
{
	GENERATED_BODY()
    
public:
    
    UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Collision) TSubobjectPtr<class USphereComponent> ProxSphere;
    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = NPCMessage) FString NpcMessage;
    
	// Sets default values for this character's properties
	ANPC();

	// Called when the game starts or when spawned
	virtual void BeginPlay() override;
	
	// Called every frame
	virtual void Tick( float DeltaSeconds ) override;

	// Called to bind functionality to input
	virtual void SetupPlayerInputComponent(class UInputComponent* InputComponent) override;

	
	
};

Hi blUnoob,

If you open the .sln directly and comment out these two UProperties then compile the build and then launch the project through the editor, does it still crash? Also, can you provide me with the callstack and/or the crash logs from the crash?

Hi blUnoob,

We haven’t heard from you in a while. Are you still experiencing this issue? If you need further assistance, please let me know and I’ll be happy to help.

I realized that the problem was arising from UProperties, but if i cloned the project and opened it, it ran! Apparently, UE4 doesn’t recompile the project code on load, and tries to open with the last compiled code. So even after changing code that bugged the project, it would crash the project cuz it never recompiles.

Unfortunately, I am not using UE4 anymore. But I must say, it crashes too much on mac and very soon gets too much to deal with. I could have ended up with a broken + trashed pc, thats the level it frustrated me to!