Helper Methods
Methods Available for Actor Classes:
Basic Spawn
AStaticMeshActor.Spawn(worldContextObject, MyActorClass);Spawns an instance of the specified class.
Spawn with Transform
AStaticMeshActor.Spawn(worldContextObject, MyActorClass, GetActorTransform());Spawns an instance of the specified class at a specific transform.
Spawn with Collision Handling
SpawnActorCollisionHandlingMethod method = SpawnActorCollisionHandlingMethod.AlwaysSpawn;
AStaticMeshActor.Spawn(worldContextObject, MyActorClass, GetActorTransform(), method, instigator, owner);Spawns an instance of the specified class with specified collision handling, instigator, and owner.
Methods Available for ActorComponent Classes:
Retrieve Component
Retrieves the StaticMeshComponent of the specified actor.
Construct New Components
Constructs new mesh components with specified owner, attachment settings, and transform.
Enabling Code Generation
To use the code generation for your custom classes (it’s already enabled for engine classes), update your project file (csproj) to include the source generator. Add the following lines to your csproj file:
Last updated