Developer Notes

Not a bug, the WidgetBlueprint is an editor only class. You can tell because it's in a module in the Editor directory. UBlueprints should've been and hopefully will in the future. You need to reference the generated UClass instead, the "_C" object that's generated when you compile a blueprint, instead of the WidgetBlueprint. e.g.
"Class'/Game/W_UnitWidget.W_UnitWidget_C'

Description

If a widget Blueprint is referenced in code, an error is displayed when the packaged game is launched stating that the widget could not be found (in 4.11 the widget still appears to be successfully found even after the error message is shown).

In the attached project, a code actor class locates a widget Blueprint by reference, then outputs a message to the screen if successful. The package settings for the project are set to perform a full build when packaging.

Steps to Reproduce
  1. Download the attached DemoWidgetPkg.zip project.
  2. Unzip the project.
  3. Associate the project with your main build (it was made using CL 2704243).
  4. Build the project in Visual Studio.
  5. Open the project in the Editor.
  6. Start PIE.
  7. Note the message displayed in the top left corner of the screen.
  8. Package the project for Win64.
  9. Launch the packaged game.

RESULT:
An error message is shown indicating that the W_UnitWidget widget could not be found (see the attached Error.png).

EXPECTED:
The game launches without any errors.

Have Comments or More Details?

Head over to the existing Questions & Answers thread and let us know what's up.

0
Login to Vote

By Design
ComponentUE - Editor - UI Systems
Affects Versions4.9.14.11
CreatedSep 24, 2015
ResolvedSep 29, 2015
UpdatedJul 14, 2021