Gameplay Tasks have builtin magic for creating nodes that spawn actors. It supports defining BeginSpawningActor
and FinishSpawningActor
functions and it will automatically do the appropriate thing.
AbilityTasks have a custom K2Node called K2Node_LatentGameplayTaskCall.
This implements some extra magic to automatically call functions within a certain pattern:
/**
* Requirements for using Begin/Finish SpawningActor functionality:
* -Have a parameters named 'Class' in your Proxy factor function (E.g., WaitTargetdata):
* -Have a function named BeginSpawningActor w/ the same Class parameter:
* -This function should spawn the actor with SpawnActorDeferred and return true/false if it spawned something.:
* -Have a function named FinishSpawningActor w/ an AActor
* of the class you spawned
* -This function *must* call ExecuteConstruction + PostActorConstruction
/
There is a list of the function names in FK2Node_LatentAbilityCallHelper
(see engine code)