Hello, I have a problem with subsystems, I am trying to create Game Instance Sub System, and setup there few UPROPERTY and set them in blueprints
for that I have done abstract Subsystem
UCLASS(Abstract, Blueprintable)
class MYGAME_API USomeSubSystem : public UGameInstanceSubsystem
Then I can create Blueprint that derived from my C++ class
But there is a problem, thats works only when I have open this blueprint in editor ar least one time, what is the problem could be?
You probably donāt have anything loading your blueprint at the right time so that subsystem initialization can see it. It only works in the editor because when itās open itās loaded before that process.
The real problem is that subsystems arenāt currently designed to be blueprintable. None of the important functions are implementable by blueprint so itās not a recommended workflow.
You either have to fake it by spawning a singleton-y type actor or configure those things through ini settings instead of through blueprint.
@MagForceSeven
Hm, and thats quit problem, becouse I want to make some kind of manager that will live all game life even when we go to another level , so game instance is a good place for that and for making such objects subsystem is a good place, but I need to use some assets byt this manager and loading that like hardcode throught C++ not the best wey,
I also thaught to make UObject insode GameInstance, but there is another problem, when we make NewObject, thats require UWorld, that means that will be spawned in World and by gowing to another level it will be deleted,
So is there some ways to use UPROPERTY that will be always accessible?
Yeah, hardcoding them in C++ is bad but you can specify through config files with paths if your subsystem has TSoftObjectPtrās.
Then youāre doing something wrong. UObjects donāt require a world to create them. They require a generic UObject āouterā but that could be anything, including the GameInstance itself.
Thereās no way for me to tell based on what youāve shared. You need to place a breakpoint and debug it. My guess would be that MyControllerBP isnāt loaded or assigned to properly.
Maybe start off by trying it without the MyControllerBP so that youāre doing it all in native.
What you have there should work just fine. If itās returning a null pointer there itās because of your inputs and not any sort of world ownership issues.
I have already tried to debug but shows nothing suspecious, MyControllerBP is not null and its ok,
Ok thank you very much for your help, I will continue looking this way then
I revisit this topic every now and then to see if Epic has added support.
Their AI developer assistant confidently says it is supported but I canāt find any supporting documentation.
Too nervous to use this in case it breaks in a fun way⦠but man it would be useful to be officially supported.
AI dev assistant:
To make a subsystem blueprintable in Unreal Engine 5.6, follow these steps:
Use UCLASS(Blueprintable) on your subsystem class declaration.
Inherit from the appropriate subsystem base, e.g., UGameInstanceSubsystem.
Expose functions and properties with Blueprint specifiers, such as UFUNCTION(BlueprintCallable) for functions and UPROPERTY(BlueprintReadWrite) for variables.
sometimes it would load and sometimes it would be nullptr. usually if i created a new blueprint child iād have to restart the editor. Also the child requires the parent even if its just an abstract base class
The C++ Subsystem works great but you canāt create a child subsystem in Blueprints. There are a few things that are just easier to do in Blueprints. In particular, referencing assets.
My goal was to make a Brutal Doom blood Subsystem. Getting access to Niagara assets in a C++ Subsystem is awkward. But I think Iāve found a solution via project settings.
if u follow the video u can create a child subsystem of your c++ subsystem, if u put logic inside your BP, u need to get your subsystem and cast the BPSubsystem, Iāll leave it there in case anyone else is looking to make subsystems in bp, maybe for your case I would use levelBP, something I would never recommend but if you have to manage references and load and unload assets it seems to me the best place
Yep, after personally doing something similar with deriving multiple levels of subsystem classes, the steps in that video seem to be correct for setting this up in BP. Nice find.