BlueprintImplementableEvent
BlueprintNativeEvent allows to define event C++ and implement its logic in the blueprint.
Updated over 4 years ago
Concept
Using the BlueprintImplementableEvent you can
-
Send event from parent C++ class to blueprint based on this class
-
Retrieve value from blueprint
PlayerController.h
.h
UFUNCTION(BlueprintImplementableEvent, meta=(FriendlyName = "Player Controller"))
void PlayerIsHealthyTick(float CurrentHealth);
That's it! This kind of event doesn't have C++ implementation.
Keep in mind that blueprint events cannot be compiled out in non-editor builds. Surrounding it with #if WITH_EDITOR directive will cause a compilation error.
Calling a BlueprintImplementableEvent in Blueprints
Make sure to include BlueprintCallable if you want to also call your event in Blueprints!
UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, Category = "Player Controller")
void PlayerIsHealthyTick(float CurrentHealth);
Returning value
If you define a C++ BlueprintImplementableEvent event with a return value, it will appear in the blueprint editor as function to override/
UFUNCTION(BlueprintImplementableEvent)
float GetBPAdjustedPlayerHealth() const;