Hello.
Is there a reason why BlueprintImplementableEvent don’t work (at least, not as easily) with AHUD derived classes ?
I’ve tested this on two projects based on the Third-Person Template. First project, I make the calls inside the default character class.
Header
UCLASS(config=Game)
class ABPCallsHUDCharacter : public ACharacter
{
(...)
/** Called by Fire() to submit some input to Bluprints */
UFUNCTION(BlueprintImplementableEvent, Category=Calls)
void MakeBPCall(int32 no);
/** Received by Blueprints after a fire event has been launched */
UFUNCTION(BlueprintCallable, Category=Calls)
void ReceiveBPCall(int32 no);
};
Source
void ABPCallsCharacter::Fire()
{
MakeBPCall(666);
}
void ABPCallsCharacter::ReceiveBPCall(int32 no)
{
GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Blue, FString::FromInt(no));
}
I mapped an Event to the Fire() button. Here’s a BP implementation: Basic stuff: Receive a number, increment by 1, send it back to C++. Works great.
However, on a separate project using TPP, I have created a MyHUD class, bound it as default in my GameMode like so:
ABPCallsHUDGameMode::ABPCallsHUDGameMode(const class FPostConstructInitializeProperties& PCIP)
: Super(PCIP)
{
// set default pawn class to our Blueprinted character
static ConstructorHelpers::FObjectFinder<UClass> PlayerPawnBPClass(TEXT("Class'/Game/Blueprints/MyCharacter.MyCharacter_C'"));
if (PlayerPawnBPClass.Object != NULL)
{
DefaultPawnClass = PlayerPawnBPClass.Object;
}
HUDClass = AMyHUD::StaticClass();
Then I create a blueprint based on AMyHUD.

I made a custom fire function in which my character can reach the HUD and calls the exact kind of function to that was successful on the earlier project. In debug mode, I see the call being traced to my custom fire shot, crossing MakeBPCall() but there is no reaction inside the Blueprint, and, of course, nothing comes out of it either.
Header
UCLASS()
class BPCALLSHUD_API AMyHUD : public AHUD
{
(...)
/** Called by Fire() to submit some input to Bluprints */
UFUNCTION(BlueprintImplementableEvent, Category=Calls)
void MakeBPCall(int32 no);
/** Received by Blueprints after a fire event has been launched */
UFUNCTION(BlueprintCallable, Category=Calls)
void ReceiveBPCall(int32 no);
};
Source
void AMyHUD::OnFire()
{
MakeBPCall(666);
}
void AMyHUD::ReceiveBPCall(int32 no)
{
GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Blue, FString::FromInt(no));
}
Is there some caveat or extra code needed to make it work under AHUD based classes ?
Cheers.
