FSubsystemCollection doesn't work as I would expect

Hi,

GetSubsystemArray(TSubclassOf) Only works for the first parent.

If I have a USubsystemChild that inherits from USubystemParent that also inherits from UGameInstanceSubsystem, then, when I call TArray<UGameInstanceSubsystem*> Subsystems = GetWorld()->GetGameInstance()->GetSubsystemArray<UGameInstanceSubsystem>(); the instance of USubsystemChild is not there.

My GameInstance's FSubsystemCollection has the SubsystemArrayMap with two entries UGameInstanceSubsystem and USubystemParent, that is one with all the different UGameInstanceSubsystem instances that the first parent is UGameInstanceSubsystem and another list with the subsystem instance that inherits USubystemParent.

From my point of view, USubsystemChild's instance should be included in the list for the map SubsystemArrayMap entry UGameInstanceSubsystem.

The problem that I have is that I need to iterate all UGameInstanceSubsystem to find one that implements an interface.

Does anybody know if this is intended or a bug? also, is there a way to get all subsystems so I can see if they implement an specific interface?

Thanks.

Apologies for the necro, however it seems I am hitting this exact same issue, when dealing with Subsystems that inherit from the same base GetSubsystemArray will only return the first one that was added. I believe the issue might be somewhere in FSubsystemCollectionBase::AddAndInitializeSubsystem, where if you add another subsystem that inherits from the same base as the first subsystem, it gets added to the SubsystemMap, but the SubsystemArrayMap will not get recalculated/updated. Perhaps there should be an update called there right under SubsystemMap.Add.

I will second Bionic_Ape’s question, is this intended behavior? Sure looks like a bug to me.
I’m on Unreal 5_3

Update: this seems fixed in the latest version of the engine, it is indeed a bug in 5_3. I ended up backporting the fix for myself, solved my issue