Hi Devs,
In my project i implemented CommonGame plugin to use UI Layout system, in my c++ class this condition return null so can not get RootLayout:
This is snippet code:
if (UPrimaryGameLayout* RootLayout = Policy->GetRootLayout(CastChecked(LocalPlayer)))
{
const ESlateVisibility DesiredVisibility = bShouldShowUI ? ESlateVisibility::SelfHitTestInvisible : ESlateVisibility::Collapsed;
if (DesiredVisibility != RootLayout->GetVisibility())
{
RootLayout->SetVisibility(DesiredVisibility);
You need to create a subsclass in C++ deriving from GameUIManagerSubsystem.
You also need to create a GameUIPolicy-derived blueprint, in which you will list which PrimaryGameLayout to use.
Then, in your DefaultGame.ini (config file), you need to create a reference to that UI policy blueprint, for the property UPROPERTY(config, EditAnywhere) TSoftClassPtr<UGameUIPolicy> DefaultUIPolicyClass;
found in UGameUIManagerSubsystem.
thanks so much, in my project i implemented all assets that your recommended above and setup inside .ini file, but the RootLayout still return null so it does not get any stacks inside W_OverallHUDLayout to active
thanks so much, rely on your note i fixed this error, before i got an error so i changed the parent class CommonGameInstance to GameInstance. Althought this is fixxed but all game features are not working now so hero can not move and do anything. But i think that i can check and fix them again.
thanks so much again.
Truc