Why does triggering character events from c++ work but not widgets?

I went through the small tutorial posted on calling blueprint events from c++. I used my character class to test it out and had the blueprint event print to screen, thus verifying the vent was called. However when I try to do the exact same thing with an extended user widget class the event does not fire.

My setup is something like this…

UFUNCTION(BlueprintImplementableEvent, Category = "KORE WIDGET")
void myExtendUserWidget_CallEvent();

myextendCharClass::SendMessage()
{
UKoreWidget* myCustomWidget;
myCustomWidget = CreateWidget<UKoreWidget>((), UKoreWidget::StaticClass());
myCustomWidget->myExtendUserWidget_CallEvent();
}

In the blue print I just pull a print off the event to check it same as I did with the character event. However it does not fire. Any ideas?

Yeah so I worked on this all day yesterday and no love. I’m really confused because it works when I call an event on my character class from code within my character class. Is there some limitation where you can’t call an event from outside the owning objects class?

Because this

 myCustomWidget = CreateWidget<UKoreWidget>((), UKoreWidget::StaticClass());

creates raw UKoreWidget class object, not the class object made out of blueprint which overrides myExtendUserWidget_CallEvent function which prints the text. Create the widget in blueprint insted, or somehow get UClass of that blueprint and use it CreateWidget insted UKoreWidget::StaticClass().

Remeber blueprint is class same as C++ class

Any idea how I could get the blueprint version from code, to use to create?

Put this in your character class header:
UPROPERTY(EditAnywhere, Category = “Widget”)
TSubclassOf KoreWidgetClass;

Now you can set the right class in your character blueprint and use it in your code instead of UKoreWidget::StaticClass().

Okay, so you were correct. The problem was that I was using the staticClass of the UKoreWidget instead of an actual reference.

UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = “KORE WIDGET”)
TSubclassOf WidgetTemplate;

The above provides a slot available in the details panel in the editor for the class the member is on (in my case I put this variable in my character class). There you can add the reference to the correct BP by selecting it. So instead of using the static class like I did at first, use the WidgetTemplate reference that is populated in the editor.