Background
Background

UMG Pre Construct - Break Down & Best Practices

In UMG Widget Blueprints, use PreConstruct for appearance derived from data the widget owns. Make it safe to repeat: the same inputs should produce the same display, without accumulating state or adding duplicate children. Use OnInitialized to bind callbacks on existing child widgets once per instance, and keep later refreshes separate.

One assignment, one counter

In my original experiment, two integers, Foo-Set and Bar-Increment, started at 0. PreConstruct assigned Foo-Set to 1, Construct assigned 2, and OnInitialized assigned 3. Each event incremented Bar-Increment once and printed its label and both values.

I initially expected PreConstruct → Construct → OnInitialized. Below are the original reported values, shown with callback names instead of the “Menu” print labels.

Assigned value is Foo-Set; Counter value is Bar-Increment. Row numbers show the call order within each context and are separate from the counter.

Editor: Compile
EventAssigned valueCounter value
1. PreConstruct11
2. PreConstruct12
Editor: Save after Compile
EventAssigned valueCounter value
1. PreConstruct13
2. PreConstruct14
In game
EventAssigned valueCounter value
1. OnInitialized31
2. PreConstruct12
3. Construct23

The editor entries keep the assigned value at 1 while the counter increases. The original engine version was not recorded, and these results do not establish fixed call counts or which object produced each entry. The runtime sequence is a single-widget observation, not a global ordering rule for nested widgets or every creation path.

Three Blueprint branches assign Foo-Set to 1, 2 or 3, increment Bar-Increment, then print the event label and both values.
The counter experiment’s setup graph. The printed strings shown here are assembled inputs, not captured output.

Choose the event for the job

UMG’s widget objects wrap Slate, Unreal’s underlying UI framework. Initializing the object and constructing its underlying UI are different lifecycle concerns.

PreConstruct runs in the editor and game for cosmetic setup. Avoid depending on gameplay state during editor evaluation. Its IsDesignTime flag helps choose preview or runtime presentation; it does not establish that gameplay dependencies or layout are ready.

Construct follows construction of the underlying Slate widget. It may repeat depending on how that Slate object and the hierarchy are used.

Pre Construct and Construct event nodes, with the Is Design Time output visible on Pre Construct.
The two construction events, with the design-time flag exposed by PreConstruct.

OnInitialized runs once at game time for each non-template UUserWidget instance. A new instance initializes separately. It suits one-time setup such as binding a child button’s click handler. It does not mean Slate construction, layout, gameplay state or presentation is complete.

The Event On Initialized node in a Widget Blueprint graph.
OnInitialized is a separate event for setup scoped to the widget instance.

Keep preview work small

Heavy setup repeated across nested widgets can add work; its cost depends on what each evaluation does. Prefer assigning presentation from current inputs over incrementing state or appending content on every preview refresh.

For assets that need asynchronous loading at runtime, give requests explicit ownership and lifetime handling, then refresh when data is ready and still relevant. Avoid launching another uncontrolled request whenever the designer reevaluates the widget. These are design recommendations, not fixes tested by the counter experiment.

Move over the bright dot and follow the line. P pauses. Escape closes the game.

Sigil Trace

Move over the sigil before time runs out.

Score0000
Spells00
Best on this browser0000
I · KINDLE SPELL 01
START

Trace the Sigil with your mouse

Start at the glowing dot and follow the line. No click needed.

or press Enter
Move your mouse onto the bright dot. No click needed.