Navigation
API > API/Runtime > API/Runtime/GameplayTasks
Convenience task for spawning actors (optionally limiting the spawning to the network authority). If not the net authority, we will not spawn and Success will not be called. The nice thing this adds is the ability to modify expose on spawn properties while also implicitly checking network role before spawning.
Though this task doesn't do much - games can implement similar tasks that carry out game specific rules. For example a 'SpawnProjectile' task that limits the available classes to the games projectile class, and that does game specific stuff on spawn (for example, determining firing position from a weapon attachment).
Long term we can also use this task as a sync point. If the executing client could wait execution until the server creates and replicates the actor down to it. We could potentially also use this to do predictive actor spawning / reconciliation.
| Name | UGameplayTask_SpawnActor |
| Type | class |
| Header File | /Engine/Source/Runtime/GameplayTasks/Classes/Tasks/GameplayTask_SpawnActor.h |
| Include Path | #include "Tasks/GameplayTask_SpawnActor.h" |
Syntax
UCLASS (MinimalAPI)
class UGameplayTask_SpawnActor : public UGameplayTask
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UGameplayTask → UGameplayTask_SpawnActor
Implements Interfaces
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| DidNotSpawn | FGameplayTaskSpawnActorDelegate | Called when we can't spawn: on clients or potentially on server if they fail to spawn (rare) | Tasks/GameplayTask_SpawnActor.h |
|
| Success | FGameplayTaskSpawnActorDelegate | Tasks/GameplayTask_SpawnActor.h |
|
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Tasks/GameplayTask_SpawnActor.h |
|
||
| Tasks/GameplayTask_SpawnActor.h |
|
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static UGameplayTask_SpawnActor * SpawnActor
(
TScriptInterface< IGameplayTaskOwnerInterface > TaskOwner, |
Spawn new Actor on the network authority (server) | Tasks/GameplayTask_SpawnActor.h |
|