Packaged project crashes at startup

I’ve quite a few issues with my packaged project. It crashes right on startup, due to [this weird error (click me!)][1].

I boiled it down to this two nodes.


When I remove the cast to BPGameMode, the game runs fine.
Completely removing and re-adding the game mode won’t make the error disappear. The BPGameMode blueprint is inherited from my C++ AGameMode class. I figured the error must’ve been produced inside my C++ class, and I’ve found something:

static ConstructorHelpers::FClassFinder<APawn> PlayerPawnBP(TEXT("/Game/Blueprints/BPCharacter"));
DefaultPawnClass = PlayerPawnBP.Class;

static ConstructorHelpers::FClassFinder<APlayerController> PlayerControllerBP(TEXT("/Game/Blueprints/BPPlayerController"));
PlayerControllerClass = PlayerControllerBP.Class;

static ConstructorHelpers::FClassFinder<APlayerState> PlayerStateBP(TEXT("/Game/Blueprints/BPPlayerState"));
PlayerStateClass = PlayerStateBP.Class;

static ConstructorHelpers::FClassFinder<AGameState> GameStateBP(TEXT("/Game/Blueprints/BPGameState"));
GameStateClass = GameStateBP.Class;

static ConstructorHelpers::FClassFinder<AHUD> HUDBP(TEXT("/Game/Blueprints/UI/BPIngameHUD"));
HUDClass = HUDBP.Class;

Produces the described error. However, only the combination produces the error, removing one small block resolves it.

Hello Leandros,

I have a few questions for you that will help narrow down what issue it is that you are experiencing.

Quick questions:

  1. Can you reproduce this issue in a clean project?
  2. If so, could you provide a detailed set of steps to reproduce this issue on our end?
  3. If you use an is valid check for the game mode does this crash still occur?
  1. I will try.
  2. Yes.
  3. No, it doesn’t change anything.

I could not reproduce the issue in a clean project. However, the issue still exists.

Ok, I found the actual error. I was using the OwningPlayerController of the HUD to call a Run on Server replicated event.
However, I could not yet find a real solution to the problem. Replacing the Get Owning PlayerController node with a Get PlayerController node (the one with index), doesn’t solve the crash.

The funny thing is, the actual point of failure is the cast to my PlayerController again.

Hello Leandros,

Would it be possible for you to provide a simplified version of the project that is having this issue? If so, you can zip it down and submitted it to this thread and I will be happy to take a closer look.

Hello Leandros,

We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will offer further assistance.

Thank you.