I need a subsystem that requires life cycle to be managed by level.
None of the subsystems provided by Unreal seem to be suitable for use currently.
Is there a way that can replace the above functionality?
hmm. Do you mean per the main level loaded? GameInstance should exist for just about the same lifetime as the main level . . .
Otherwise, there is the possibility (quite likely in most setups, I would think) that several levels could be loaded at once, and subsystems are more of a singleton thing that exist as long as the thing it depends on exists… so having a subsystem instance for each level loaded doesn’t really connect with that concept.
Can you give an example of what you might use this to do?
I didn’t know that the GameInstance created by per level.
Maybe I can try GameInstanceSubsystem. Thank you
GameInstance should be pretty close to living the same time as the main level.
GameInstance lifetime is while the game is running. For “level” lifetime use UWorldSubsystem
.
https://docs.unrealengine.com/4.27/en-US/API/Runtime/Engine/Subsystems/UWorldSubsystem/
Thanks I think It looks more close for me.
oof, does it not unload the GameInstance between levels these days by default? My bad, sorry if I gave bad information