Casting blueprint getting nullptr?

I have no idea what’s going on… Every time I try to package for testing my game I get this error. I started my project on unreal 4.6, so it’s not an import problem.

The only thing I’ve been able to understand is that if I remove the animation blueprint from myCharacter, I do not get this error.

In editor the game works fine. No error messages on the outputlog or anything.

Here’s the error on the output log when I try to package:
[2014.12.13-18.08.19:642][ 4]MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: Fatal error: [File:D:\BuildFarm\buildmachine_++depot+UE4-Releases+4.6\Engine\Source\Runtime\CoreUObject\Private\Templates\Casts.cpp] [Line: 11]

[2014.12.13-18.08.19:643][ 4]MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: Cast of nullptr to Blueprint failed

anyone had something similar happen to them?

I get the same error when trying to package or cook the project. Also using 4.6, but didn’t try to on previous versions.

I think it might be related a to a problem I have, because there is a crash I get also saying Cast to nullptr to blueprint failed.

I have a blueprint called BP_GameChar that casts BP_GameHUD in an Event. If I open BP_GameHUD or BP_GameMode (that has BP_GameHUD set as the HUD Blueprint) before opening BP_GameChar, I get a crash: link text

If I remove the code where BP_GameChar casts and calls a function of BP_GameHUD, it doesn’t crash anymore, so it has to be some kind of reference problem.

Also, If I compile BP_GameChar, I need to recompile BP_GameMode, if I recompile BP_GameMode, i need to recompile BP_GameChar, so I never have both blueprints successfully compiled.

The Package error occurs when it is processing BP_GameMode, so it has to be related.

Wow comment to big, maybe I’ll create my own question later., but yes, I have a similar problem.

Hey, so I’ve been trying to fix this problem over the past few days, and I realized that it was not really my animation cast, but the character blueprint. I erased segment by segment and cooked, until I found the one that was causing problems. I moved this specific task to the player controller rather than the character itself and it now cooks, tho I’m sure this is not the correct way to solve it, but at least I can cook the game for now.

edit: Yeah my error log looks very similar to yours.

Wow, I did what you said and it doesn’t crash anymore. I moved the task to the PlayerController.

Instead of getting the HUD from the PlayerController and calling a HUD function, I created a function in the PlayerController that calls that same function. Basically made the PlayerController work as intermediate between BP_GameChar and BP_GameHUD.

Changed this:

To this:

Thank you I didn’t think of doing this before.