Daily Unreal Column #57 - Blueprint Async Action Nodes
I'm pretty sure that you have seen and used async nodes. They are also often called latent nodes. But do you know that creating your own async blueprint node is very easy?
The hero of today’s column is a UBlueprintAsyncActionBase
class. In order to create your own latent node, all you need to do is create a subclass of this engine class.
Once you have a new class created, each declared dynamic multicast delegate will create new out execution pin on this node. For example, let’s take a look how UAsyncActionHandleSaveGame
is implemented. This is declaration of the delegate:
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(
FOnAsyncHandleSaveGame,
USaveGame*,
SaveGame,
bool,
bSuccess);
UPROPERTY(BlueprintAssignable)
FOnAsyncHandleSaveGame Completed;
It also contains set of static functions allowing the node to be created in blueprint graph node with a specified parameters.
As we can see, the completed delegate is represented as a separete output execution pin that is being called the moment this delegate is broadcasted.