Need an Event for SpawnActorDeferred

We are making a plugin that needs to be able to spawn instances of an actor class that the customer authors, and then adds components to that instance at runtime. We do not want to mandate that the customer inherits from a class we provide, nor require that they manually add one of our components to their actor. So we can do this in code; the last quality of life improvement that would be great is, if we can query the list of components that were manually added to the class definition, and install the component(s) we want that are “missing”, prior to BeginPlay firing in the new actor instance.

According to the flowchart here, if you use SpawnActorDeferred you can do what you like before calling FinishSpawningActor and the UWorld will fire OnActorSpawned after the components have been set up but before BeginPlay happens. Unfortunately, our investigations show this is not the case. OnActorSpawned is fired in UWorld::SpawnActor, which is called from SpawnActorDeferred, which means it fires both before we can record the new AActor* that SpawnActorDeferred returns, and before the Components list has been created.

Additionally, DispatchBeginPlay happens at the end of AActor::PostActorConstruction(), which means that for regular actor spawning, BeginPlay occurs before OnActorSpawned. For deferred actor spawns, BeginPlay happens during FinishSpawningActor and the order is reversed.

I don’t suppose we could get an additional event added near the end of AActor::PostActorConstruction, the is guaranteed to occur post-component construction but pre-BeginPlay? I would also take any other suggestions on how to non-invasively run code between those two steps for a spawned Actor, but looking at the engine code I’m not seeing it.