Blueprint Events to C++¶
BlueprintImplementableEvent¶
Add NotifyQuestActor to Grabber.h
UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
void NotifyQuestActor(AActor* Actor);
You could now replace the BluePrint event with the C++ equivalent.
BlueprintNativeEvent¶
In Blueprint rename TraceForPhysicsBodies to BP_TraceForPhysicsBodies
In Grabber.h add UFUNCTION
Notice that the BP function returns 3 values. In C++ we’ll return 1 and use output parameters for the other 2.
UFUNCTION(BlueprintCallable, BlueprintNativeEvent)
bool TraceForPhysicsBodies(AActor*& HitActor, UPrimitiveComponent*& HitComponent);
In Grabber.cpp add implementation, note the name has _Implementation as suffix
bool UGrabber::TraceForPhysicsBodies_Implementation(AActor*& HitActor, UPrimitiveComponent*& HitComponent)
{
return false;
}
Override TraceForPhysicsBodies in Blueprint:
Replace reference of BP_TraceForPhysicsBodies with TraceForPhysicsBodies and then delete BP_TraceForPhysicsBodies.