I loaded a Widget Blueprint in the BeginPlay event of the game mode and the UI is visible, but the buttons are not in the correct position until one frame has passed (shown in this video, I slowed the editor down to 3 fps to show):
This also happens in the simulation tab in the widget blueprint editor.
How do I fix this?
Calling Force layout prepass in the construct event didn’t work; I needed to hide it initially and then show the widget after a frame. Seems like it is a bug as shown on the issues list here Unreal Engine Issues and Bug Tracker (UE-137604)
Are you using a scale box? I wonder if calling prepass for the entire widget before adding it to the viewport / container would fix this. Seems like it’s related, the bug you refer to mentions prepassing the layout improves the behaviour, albeit does not fix it.
I’m also having this issue with a loading screen. I took the lyra loading screen code, and the first frame shows my text looking wrong. No amount of ForceLayoutPrepass can fix this, which seems like it’s caused by a bug.
The problem is, this first frame is very long and lasts the duration of the map load. If the bug isn’t fixed, I’ll have to preshow the loading screen before starting a level transition.