I’m trying to make GameInstance available from any class to store some global variables in it, and so I have created some c++ code in my plugin, since GameInstance is not usually available from UObject.
I have a custom GameInstance blueprint called GlobalVariables, and it is set in the project settings to be the GameInstance to be used
Oh yes I forgot that It is only in C++. Allegedly they are making the Subsystem Blueprintable in later versions (4.24 4.25?) but for now it is only available in C++.
It is rather simple to add a Property in C++ to make it globally available like this though. Even a Blueprint developer should know how to do this.
That might be rated to you casting to UGameEnigne while editor use UEditorEnigne, also double check if oyu set gmae instance class correcly, check what class of object your function actully return, also on which event do you running that?
I think insed of looking to getting something from UEngine it might be easier to access UWorld insted and get UGameInstance from there. For starters there UWorld global pointer GWorld but it might not be reliable in editor considering multiple UWorld instances running in it. You can get any actor and get world from it, and from UEngine you can get PlayerController for example: