Updating variable in UMG from GI / GM. Why? and How?

OnInitialized runs once during play time, as long as the widget has a valid owner. Construct runs at least once during play time, running again when its slate widget needs to be reconstructed. This happens after OnInitialized but every single time the widget is removed / added or modified in certain ways. Note: PreConstruct works just like Construct but runs after OnInitialized, before Construct, and not only does it run during play time it also runs in the editor. Another thing to be aware of is that some BP properties exposed as pins on CreateWidget are not initialized during OnInitialized (funny I know) but are available during Construct. Things you need to set up only ONCE such as delegate bindings go into OnInitialized. things that update when the slate widget updates (i believe style properties, setting text etc.) go in Construct or PreConstruct.

I’m collecting info on Slate and UMG here:

WIP Guide to Slate / UMG + dealing with current issues.

1 Like