UCLASS()
class MY_API UMyGameInstanceSubsystem : public UGameInstanceSubsystem
{
GENERATED_BODY()
public:
//~ Begin USubsystem interface
virtual bool ShouldCreateSubsystem(UObject* Outer) const override { return true; };
virtual void Initialize(FSubsystemCollectionBase& Collection) override {};
virtual void Deinitialize() override {};
//~ End USubsystem interface
};
I receive a compilation error:
MyGameInstanceSubsystem.h(2): error : /Script/MY.MyGameInstanceSubsystem's superclass must be /Script/Engine.WorldSubsystem, not /Script/Engine.GameInstanceSubsystem
What do I do wrong? In Engine/Public/Subsystems/Subsystem.h it is written that supported subsystems are:
Oh cr**. Sorry. I took the U by accident when I was covering project info. There is an extra U at the beginning and this error is still there. I will edit my original post to not confuse others. Thank you for your reply.
Well, it was naive by me. I started to change names and it compiled, so I started to investigate. I have used the UMyGameInstanceSubsystem in another file by accident and it was inheriting from a world subsystem. What a coincidence. I am happy I can continue now!
@knapeczadam Thank you for your help! I managed to figure it out somehow and I posted the answer. It was stupid by me, I should always keep the git commit workflow but I was lazy for a moment. Take care.
I cannot even run the editor because I cannot compile my code. It is interesting that you can create a blueprint version. I have to do something wrong.