5.3 CreateWidget - CommonUserWidget - BAD on restart

100% reproducable by these steps:

New Project 5.3 (Source build)
Enable CommonUI plugin (Restart editor)
Create a widget (CommonUserWidget) blueprint
Do NOTHING in it.
PController → BeginPlay() → CreateWidget(thisWidgetMade) (NOTHING ELSE)
play game - no problems.

Restart Editor

Come back into editor with the shown error: https://puu.sh/K39zJ/39e066b5da.png
Widget is unable to be opened.

PCONTROLLER:
Delete node (now shows as Construct NONE) - https://puu.sh/K39zP/5a1316e9e7.png
restart editor
Come back into project - voilah - widget is re-classed to CommonUserWidget and is able to be opened… can rinse/repeat this until hail mary comes of earth.

:confused:

fwiw - already checked - UProject has:

{
“Name”: “CommonUI”,
“Enabled”: true
},

After speaking with a member on UE Slackers discord group - found that htis is because of lifecycle events of attempting to access HardReference object (pointers) in blueprint - of a specialized type.

Namely - my widget class for this hud is CommonUserWidget.
I’ve created the scenario addressed above. The moment that you either A: Cast to or B: set variable of type Object* - it is invalid because the plugin is not yet loaded.

This was solved by:

AsyncLoadClassAsset(SoftClass*) → CastToUserWidgetClass → CreateUserWidget

This was successful after several restarts of the editor.

Anywhere AFTER BeginPlay is established - I am able to cast to the specific HUD class of my widget and access functionality there.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.