UE5.6: Issue with Getting Blueprint Subsystem Classes After Engine Restart
Problem Description:
In UE5.6, after creating a C++ class that inherits from a subsystem (e.g., UGameInstanceSubsystem) and marking it as Blueprintable, then creating Blueprint classes that inherit from this C++ class, I encounter an issue every time I open the engine.
After launching the engine, I can only get one of the Blueprint-inherited subsystem classes via the Get Subsystem node in Blueprints.
The specific pattern is: whichever Blueprint subsystem class I open first in the editor becomes the only one accessible.
For example:
- If I open
BP_A_Subsystemfirst after engine launch, then in Blueprints, will only return an instance ofBP_A_Subsystem_C. - Conversely, if I open
BP_B_Subsystemfirst, then onlyBP_B_Subsystem_Ccan be searched.
In my specific case, TestGI and Test_Tick are based on different C++ subsystem classes (e.g., one inherits from UGameInstanceSubsystem and the other from FTickableWorldSubsystem, as shown in my screenshot).
Below is my relevant code snippet:
//=====================UBPTickableWorldSubsystem=========================
//BPTickableWorldSubsystem.h
#pragma once
#include "CoreMinimal.h"
#include "Subsystems/WorldSubsystem.h"
#include "BPTickableWorldSubsystem.generated.h"
/**
*
*/
UCLASS(Abstract, Blueprintable)
class My_API UBPTickableWorldSubsystem : public UTickableWorldSubsystem
{
GENERATED_BODY()
public:
virtual void Initialize(FSubsystemCollectionBase& Collection) override;
UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, Category = "Subsystem", meta = (DisplayName = "Initialize"))
void ReceiveInitialize();
virtual void Deinitialize() override;
UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, Category = "Subsystem", meta = (DisplayName = "Deinitialize"))
void ReceiveDeinitialize();
// Tickable接口实现
virtual void Tick(float DeltaTime) override;
virtual TStatId GetStatId() const override;
virtual bool IsTickable() const override { return true; }
UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, Category = "Subsystem", meta = (DisplayName = "Tick"))
void ReceiveTick(float DeltaTime);
};
//BPTickableWorldSubsystem.cpp
#include "Tool/BPTickableWorldSubsystem.h"
void UBPTickableWorldSubsystem::Initialize(FSubsystemCollectionBase& Collection)
{
Super::Initialize(Collection);
ReceiveInitialize();
}
void UBPTickableWorldSubsystem::Deinitialize()
{
ReceiveDeinitialize();
Super::Deinitialize();
}
void UBPTickableWorldSubsystem::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
ReceiveTick(DeltaTime);
}
TStatId UBPTickableWorldSubsystem::GetStatId() const
{
RETURN_QUICK_DECLARE_CYCLE_STAT(UBPTickableWorldSubsystem, STATGROUP_Tickables);
}
//=====================UBPGameInstanceSubsystem==========================
//UBPGameInstanceSubsystem.h
#pragma once
#include "CoreMinimal.h"
#include "Subsystems/GameInstanceSubsystem.h"
#include "BPGameInstanceSubsystem.generated.h"
/**
*
*/
UCLASS(Abstract, Blueprintable)
class My_API UBPGameInstanceSubsystem : public UGameInstanceSubsystem
{
GENERATED_BODY()
public:
virtual void Initialize(FSubsystemCollectionBase& Collection) override;
UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, Category = "Subsystem", meta = (DisplayName = "Initialize"))
void ReceiveInitialize();
virtual void Deinitialize() override;
UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, Category = "Subsystem", meta = (DisplayName = "Deinitialize"))
void ReceiveDeinitialize();
};
//BPGameInstanceSubsystem.cpp
#include "Tool/BPGameInstanceSubsystem.h"
void UBPGameInstanceSubsystem::Initialize(FSubsystemCollectionBase& Collection)
{
Super::Initialize(Collection);
ReceiveInitialize();
}
void UBPGameInstanceSubsystem::Deinitialize()
{
ReceiveDeinitialize();
Super::Deinitialize();
}
----------------------------------------
------------------------------------------------
I recall that in previous versions, Blueprint Subsystems created using the same inheritance method were not directly searchable in Blueprints, but in UE 5.6, it appears that they can now be searched for directly.
This behavior seems to be tied to the editor’s initialization order or subsystem class caching. Any insights into why this happens or how to reliably get the correct Blueprint subclass instance would be greatly appreciated. Thank you! ![]()
