You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to know, isn't it possible to show a UUserWidget on this Loading Screen?
I'm trying to implement that by providing a reference to my UMG Blueprint and utilize it during loading process.
But my problem is that I'm weak in C++ and a specially C++ Unreal stuff and this is hard for me to estimate is this I who is writing code with wrong syntax or this is just impossible due to other limitations.
I'm pushing a new property declaration into LoadingScreenSettings.h like so:
// Reference UMG Asset in the Editor
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Widgets")
TSubclassOf wMainMenu;
// Variable to hold the widget After Creating it.
UUserWidget* MyMainMenu;
this is fine, i can provide a UMG BP class to it from editor.
and after I need to do something like this in LoadingScreenModule.cpp:
if (wMainMenu) // Check if the Asset is assigned in the blueprint.
{
// Create the widget and store it.
MyMainMenu = CreateWidget(this, wMainMenu);
if (MyMainMenu)
{
MyMainMenu->AddToViewport();
}
}
and here comes my troubles.
[1] MyMainMenu = CreateWidget(this, wMainMenu); // I need to provide a ref to current PlayerController instead of 'this' but i don't know how to get it (if possible at all)
[2] Trying to get this player controller by doing this: GEngine::GetWorld()->GetFirstPlayerController();
[3] Trying to access wMainMenu and MyMainMenu like followings: Settings->StartupScreen.wMainMenu and Settings->MyMainMenu
[4] Is this totally possible to add the UMG into this?
The text was updated successfully, but these errors were encountered:
No - it can't be created early enough for startup screens - and you'd be running blueprints on another thread. We don't do it in any of our games - the only place it's safe to do is when you're doing server travel / streaming and you don't hard block on loading the levels - in which case it's all running on the main thread still.
Hey,
I want to know, isn't it possible to show a UUserWidget on this Loading Screen?
I'm trying to implement that by providing a reference to my UMG Blueprint and utilize it during loading process.
But my problem is that I'm weak in C++ and a specially C++ Unreal stuff and this is hard for me to estimate is this I who is writing code with wrong syntax or this is just impossible due to other limitations.
I'm pushing a new property declaration into LoadingScreenSettings.h like so:
// Reference UMG Asset in the Editor
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Widgets")
TSubclassOf wMainMenu;
this is fine, i can provide a UMG BP class to it from editor.
and after I need to do something like this in LoadingScreenModule.cpp:
if (wMainMenu) // Check if the Asset is assigned in the blueprint.
{
// Create the widget and store it.
MyMainMenu = CreateWidget(this, wMainMenu);
and here comes my troubles.
[1] MyMainMenu = CreateWidget(this, wMainMenu); // I need to provide a ref to current PlayerController instead of 'this' but i don't know how to get it (if possible at all)
[2] Trying to get this player controller by doing this: GEngine::GetWorld()->GetFirstPlayerController();
[3] Trying to access wMainMenu and MyMainMenu like followings: Settings->StartupScreen.wMainMenu and Settings->MyMainMenu
[4] Is this totally possible to add the UMG into this?
The text was updated successfully, but these errors were encountered: