I definitely agree. Why can we spawn AI in CS but not spawn from class? It makes perfect sense from a level-building perspective to randomly populate a scene beforehand so it isn’t different every time.
A workaround I’ve found though is to spawn your actors at runtime, select them all in the scene outliner and copy them. Then stop the game and paste your copied actors. It’s a workaround, but it’s an option!
Can you provide some more details on what you mean by spawn AI in Construction Script?
Spawning Actors directly in the construction script would result in massive duplication of the generated Actors as the construction script gets re-run a lot of times unless we did a substantial amount of work to associate the spawned actors back to their parent … kind of like what ChildActorComponent does. And before you ask why we don’t just make Spawn Actor do the ChildActorComponent thing automatically, it isn’t really all that possible (and certainly isn’t good API design) to make SpawnActor behave differently in construction script vs. event graph.
ChildActorComponent is absolutely the right way to do this and we do plan on making it parameterizable both for which class and likely the same expose on spawn parameters will also be available. Unfortunately, there are some other things that are currently taking priority (cyclic dependencies in blueprints is probably the most directly involved) so I can’t give you a timeline, but it is something we plan on doing.
Thanks for pointing that out, that is definitely a bug. I’ve filed a ticket on that to the appropriate team.
I’m not sure there is much in the way of explicit documentation. ChildActorComponent is a SceneComponent that can be added via the Components panel of the Blueprint editor or via a Add Component node in a Construction or Event Graph. It manages the lifetime of an Actor of a given class that is spawned in the world and attached to the component, so as the component’s position changes so does the Actor’s.