You would have to access the game instance and cast the type to your derived class:
MyUplatformGameInstance* GI = Cast<MyUplatformGameInstance>(GetWorld()->GetGameInstance());
if (GI != NULL)
{
// Access your custom game instance members here
}
I have an UplatformGameInstance derived class. I would like to access that class from a WebBrowser widget. There are some properties in the MyUplatformGameInstance class I would like to check when instantiating the widget.
Problem is (beside me being UE newbie) that I can not find any good advice on how to access other class instances even from blueprints in general, or from WebBrowser widget in specific.
To further complicate things, it seems that UplatformGameInstance does not have any static singleton instance reference available.
So, there are couple of ways how to go forward (like deriving a MyWebBrowser, and adding a static singleton ref to the MyPlatformGameInstance), but those seem so clumsy that I suspect there are some standard UE ways to solve this?
It seems that I can use the GetGameInstance directly in the widget blueprint graph too, and cast the result into MyPlatformGameInstance, so that will solve the other problem also.