Class GameplayTask_SpawnActor
Convenience task for spawning actors (optionally limiting the spawning to the network authority).
Inherited Members
Namespace: UE4.GameplayTasks
Assembly: UE4DotNet.dll
Syntax
public class GameplayTask_SpawnActor : GameplayTask
Remarks
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 him. We could potentially also use this to do predictive actor spawning / reconciliation.
Properties
| Improve this Doc View SourceClassToSpawn
Class to Spawn
Declaration
public SubclassOf<Actor> ClassToSpawn { get; set; }
Property Value
Type | Description |
---|---|
SubclassOf<Actor> |
DefaultObject
Get UE4 Default Object for this Class
Declaration
public static GameplayTask_SpawnActor DefaultObject { get; }
Property Value
Type | Description |
---|---|
GameplayTask_SpawnActor |
StaticClass
Get UE4 Class
Declaration
public static Class StaticClass { get; }
Property Value
Type | Description |
---|---|
Class |
Methods
| Improve this Doc View SourceBeginSpawningActor(UObject)
Begin Spawning Actor
Declaration
public (Actor, bool) BeginSpawningActor(UObject WorldContextObject)
Parameters
Type | Name | Description |
---|---|---|
UObject | WorldContextObject |
Returns
Type | Description |
---|---|
System.ValueTuple<Actor, System.Boolean> |
FinishSpawningActor(UObject, Actor)
Finish Spawning Actor
Declaration
public void FinishSpawningActor(UObject WorldContextObject, Actor SpawnedActor)
Parameters
Type | Name | Description |
---|---|---|
UObject | WorldContextObject | |
Actor | SpawnedActor |
New(UObject, Name)
Spawn an object of this class
Declaration
public static GameplayTask_SpawnActor New(UObject obj = null, Name name = default(Name))
Parameters
Type | Name | Description |
---|---|---|
UObject | obj | |
Name | name |
Returns
Type | Description |
---|---|
GameplayTask_SpawnActor |
SpawnActor(Byte, Vector, Rotator, SubclassOf<Actor>, Boolean)
Spawn new Actor on the network authority (server)
Declaration
public static GameplayTask_SpawnActor SpawnActor(byte TaskOwner, Vector SpawnLocation, Rotator SpawnRotation, SubclassOf<Actor> Class, bool bSpawnOnlyOnAuthority)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | TaskOwner | |
Vector | SpawnLocation | |
Rotator | SpawnRotation | |
SubclassOf<Actor> | Class | |
System.Boolean | bSpawnOnlyOnAuthority |
Returns
Type | Description |
---|---|
GameplayTask_SpawnActor |
Operators
| Improve this Doc View SourceImplicit(IntPtr to GameplayTask_SpawnActor)
Convert from IntPtr to UObject
Declaration
public static implicit operator GameplayTask_SpawnActor(IntPtr p)
Parameters
Type | Name | Description |
---|---|---|
System.IntPtr | p |
Returns
Type | Description |
---|---|
GameplayTask_SpawnActor |