Unreal won't load as long as building succeeds

Basically, any time I can get my code to build correctly, Unreal crashes on launch with the following ‘error’:

MachineId:

EpicAccountId:

No minidump found for this crash.

I’ve tried deleting the build, saved, and intermediate files as well as regenerating visual studio files. All the same result.

Can you debug from Visual Studio?

Yeah, here’s the log.

Can you show me your controller code? I think the issue is originating from there.

BasePlayerController /Script/MegaRisk.Default__BasePlayerController.Sprite: Subobject class setup is only allowed in base class constructor call (in the initialization list)
UE4Editor.exe has triggered a breakpoint.

And the implementation? :slight_smile:

I’ve got nothing in the .cpp so far. Here’s the .h

#include "GameFramework/PlayerController.h"
#include "BaseGameState.h"
#include "Player/BasePlayerState.h"
#include "BasePlayerController.generated.h"

/**
 * 
 */
UCLASS()
class MEGARISK_API ABasePlayerController : public APlayerController
{
	GENERATED_BODY()

protected:

	class ABasePlayerState playerState;
	class ABaseGameState gameState;

public:

	UPROPERTY(BlueprintReadWrite, Category = "tcard")
		int32 SelectedTCardCount;
	
	
};

As I said, there’s nothing in there:

#include "MegaRisk.h"
#include "BasePlayerController.h"

Sorry missed that, getting late here.

Where’s this → Default__BasePlayerController.Sprite coming from?

The closest thing I can find to help you finding an answer is here:

I never made any sort of sprite myself.

Also, I took removed the BasePlayerController and it’s still giving me the same errors.

Awesome, no idea how I’ve never come across this. Any chance you know where this is documented? Can’t seem to find it.

The thing is if he would declare them as uproperty the header tool would output an error saying that it is not allowed.

Sorry at a loss. My next step would be to grab your project and look for myself. Hopefully Epic or someone with more experience steps up.

You are not allowed to declare any UObject derived class as a variable, you can only declare pointers to them.
Change:

    class ABasePlayerState playerState;
     class ABaseGameState gameState;

To:

    class ABasePlayerState* playerState;
    class ABaseGameState* gameState;

The error
BasePlayerController /Script/MegaRisk.Default__BasePlayerController.Sprite: Subobject class setup is only allowed in base class constructor call (in the initialization list) UE4Editor.exe has triggered a breakpoint
Originates from a call to the constructors of playerState and gameState being call outside of the allowed scope due to the deceleration of them as a variable their constructor is called automatically when your object is created.

That seemed to do it. Thanks, everyone.