We want to react on the Outliner selection while PIE, this works for normal actors, but not for Child-Actors spawned via a ChildActorComponent.
The Child-Actor “seems” select-able via PIE/Outliner, tooltip hover info is also shown for the object. The selection indicator also highlight the actor, while details is empty and can only be show via the actual ChildActorComponent selction.
We just want the reference to the actual Child-Actor, selected via the Outliner.
Neither of the callback methods work, the callback will trigger for the selection, but the selection itself is empty.
via FLevelEditorModule
FLevelEditorModule& LevelEditorModule = ModuleManager::GetModuleChecked<FLevelEditorModule>("LevelEditor");
LevelEditorModule.OnActorSelectionChanged().AddUObject(this, &UCustomGameInstance::HandleOnActorSelectionChanged);
void HandleOnActorSelectionChanged(const TArray<UObject*>& NewSelection, bool bForceRefresh)
{
// NewSelection is empty for ChildActor Outliner selection
}
via USelection
OnSelectionChangedDelegateHandle = Selection::SelectionChangedEvent.AddUObject(this, &OnSelectionChanged);