ReceiveHitBoxClick() problem

Hi,
I am rewriting my game UI from blueprint into C++.
It all seems to work fine, I created textures and hitboxes etc, but I can’t get ReceiveHitBoxClick to work.
I tested the HitBox using ConsoleCommand “showdebug hitbox”, it all works fine, my problem is with overriding the method in c++, it cannot find it.
I was searching, but everywhere there is talk about UMG and other solutions, even creating own button systems, but no clear simple example anywhere…

Problem is I want to get the event after the hitbox is clicked, so I try to add this to myHud.h and compile:

void ReceiveHitBoxClick(const FName BoxName) override;

I even found a post where someone says he is doing it like this too, but all I get is “method with override specifier ‘override’ did not override any base class methods”, because it can’t find the function, if I use intellisense it shows it in the list, I can select it, but on compile it always fails.
It’s my first time dealing with these functions but obviously I am missing something… Yes it all works in the blueprint, and there are other ways of doing this , but that’s not the point… any ideas?

Hey Jurif-

The reason you’re seeing the “does not override a base class member” message is because the ReceiveHitBoxClick() function is marked as BlueprintImplementableEvent in its UFUNCTION() specifier list and does not have it’s own code implementation. Because of this, the function can be called in code but not overriden.

Cheers

Hey -

Thank you for your answer! Cheers :smiley:
I see now, I should have looked at the functions in the HUD.cpp.
So if anyone else will this, solution is to use the NotifyHitBoxClick function:

void AMy_HUD::NotifyHitBoxClick(FName BoxName) override;