CommonUI - Oninitialized not called again after "open level by name".

Hello,

I am building a game based on Lyra in UE 5.5 with CommonUI. Here I use a plugin which has some UI elements.

These elements depend on the “oninitialized” event which seems to be called only once when the UI is created.

My problem now is that after I load a savegame by calling “open level by name” the UI is not fully reloaded if I stay in the same level (with the same userfacing experience that contains the plugins’ hud elements).

Then everything is broken because the playercontroller holding a component that the UI needs is gone and since oninitialized is not called again this is not retreived from the new player controller.

Thing I have tried without luck:

  • Find a way to remove all CommonUI things so that I could force UE to rebuild everything after loading
  • Doing the initialization stuff on “constructed” instead of the “oninitialized” event → This broke even more stuff in the plugin…

Is there a way I can reload CommonUI completely or remove all Widgets from stacks befor I load a new level from a savegame?

Thanks in advance,
ForgeOfFantasy

Same Quesition, Have u Ever Fixed It?

CommonActivatableContainers have built-in widget pools for CommonActivatable widgets. OnInitialized is called only when widget is created, but not when it is taken from the pool. In Lyra owner of all UI elements is UPrimaryGameLayout widget, which is owned by UGameUILayout object, which is owned by UGameUIManagerSubsystem, which is owned by UGameInstance. In short, hierarchy is UGameInstance → UGameUIManagerSubsystem → UGameUILayout → UPrimaryGameLayout → UCommonActivatableContainers → UCommonActivatables. (all of this this is in CommonGame plugin, btw). Having UGameInstance as owner means objects are never deleted. So your CommonActivatableContainers exist until you close the game, and all pools and all widgets in those pools also exist. You MainMenu widget still exists after 2 hours of wandering inside your world, HUD exists if you go back to MainMenu, all pop-up windows (if you are using Modal stack in UILayout widget) exist until you close the game.

That is why OnInitialized is never called again.