Show / Hide Table of Contents

Class GameplayTask_SpawnActor

Convenience task for spawning actors (optionally limiting the spawning to the network authority).

Inheritance
System.Object
UObject
GameplayTask
GameplayTask_SpawnActor
Inherited Members
GameplayTask.EndTask()
GameplayTask.ReadyForActivation()
GameplayTask.InstanceName
GameplayTask.ChildTask
UObject.TransientPackage
UObject.CastTo<T>(UObject)
UObject.CastTo(UObject, Type)
UObject.RemoveObject(UObject)
UObject.MakeObjectArrayField<T>(NativeArray*)
UObject.NotImplemented<T>()
UObject.Construct()
UObject.GetHashCode()
UObject.GetName()
UObject.ToString()
UObject.Name
UObject._None
UObject.None
UObject.ObjPointer
UObject.LoadObjectFromClass(Class, UObject, String, String, LoadFlags, PackageMap, Boolean)
UObject.LoadClass(Class, UObject, String, String, LoadFlags, PackageMap)
UObject.GetPropertyFor<T>(Name)
UObject.ExecuteUbergraph
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
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 Source

ClassToSpawn

Class to Spawn

Declaration
public SubclassOf<Actor> ClassToSpawn { get; set; }
Property Value
Type Description
SubclassOf<Actor>
| Improve this Doc View Source

DefaultObject

Get UE4 Default Object for this Class

Declaration
public static GameplayTask_SpawnActor DefaultObject { get; }
Property Value
Type Description
GameplayTask_SpawnActor
| Improve this Doc View Source

StaticClass

Get UE4 Class

Declaration
public static Class StaticClass { get; }
Property Value
Type Description
Class

Methods

| Improve this Doc View Source

BeginSpawningActor(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>
| Improve this Doc View Source

FinishSpawningActor(UObject, Actor)

Finish Spawning Actor

Declaration
public void FinishSpawningActor(UObject WorldContextObject, Actor SpawnedActor)
Parameters
Type Name Description
UObject WorldContextObject
Actor SpawnedActor
| Improve this Doc View Source

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
| Improve this Doc View Source

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 Source

Implicit(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
  • Improve this Doc
  • View Source
Back to top Generated by DocFX