UK2Node_LatentGameplayTaskCall::ExpandNode

This is essentially a mix of K2Node_BaseAsyncTask::ExpandNode and K2Node_SpawnActorFromClass::ExpandNode.

Unreal Engine C++ API Reference > Editor > GameplayTasksEditor > UK2Node_LatentGameplayTaskCall

References

   
Module GameplayTasksEditor
Header /Engine/Source/Editor/GameplayTasksEditor/Classes/K2Node_LatentGameplayTaskCall.h
Include #include "K2Node_LatentGameplayTaskCall.h"
Source /Engine/Source/Editor/GameplayTasksEditor/Private/K2Node_LatentGameplayTaskCall.cpp
virtual void ExpandNode
(
    class [FKismetCompilerContext](API\Editor\KismetCompiler\FKismetCompilerContext) & CompilerContext,
    [UEdGraph](API\Runtime\Engine\EdGraph\UEdGraph) * SourceGraph
)

Remarks

This is essentially a mix of K2Node_BaseAsyncTask::ExpandNode and K2Node_SpawnActorFromClass::ExpandNode. Several things are going on here: -Factory call to create proxy object (K2Node_BaseAsyncTask) -Task return delegates are created and hooked up (K2Node_BaseAsyncTask) -A BeginSpawn function is called on proxyu object (similiar to K2Node_SpawnActorFromClass) -BeginSpawn can choose to spawn or not spawn an actor (and return it) -If spawned: -SetVars are run on the newly spawned object (set expose on spawn variables - K2Node_SpawnActorFromClass) -FinishSpawn is called on the proxy object

Also, a K2Node_SpawnActorFromClass could not be used directly here, since we want the proxy object to implement its own BeginSpawn/FinishSpawn function (custom game logic will often be performed in the native implementation). K2Node_SpawnActorFromClass also requires a SpawnTransform be wired into it, and in most ability task cases, the spawn transform is implied or not necessary.


Ask questions and help your peers Developer Forums

Write your own tutorials or read those from others Learning Library