# UMG Widget blueprint canvas is not set correctly for the first frame

**URL:** <https://forums.unrealengine.com/t/umg-widget-blueprint-canvas-is-not-set-correctly-for-the-first-frame/625751>\
**Category:** UI\
**Tags:** unreal-engine, UE5-0, question, UMG\
**Created:** [August 10, 2022, 7:30pm UTC](https://forums.unrealengine.com/t/umg-widget-blueprint-canvas-is-not-set-correctly-for-the-first-frame/625751 "2022-08-10T19:30:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![pblpbl](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@pblpbl](https://forums.unrealengine.com/u/pblpbl)\
**Post date:** [August 10, 2022, 7:30pm UTC](https://forums.unrealengine.com/t/umg-widget-blueprint-canvas-is-not-set-correctly-for-the-first-frame/625751/1 "2022-08-10T19:30:46Z")

</div>

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):

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/4/5/e457203b273cc87675356aa8147d0bd1bdd4a1e8.jpeg "MyProject Unreal Editor 2022 08 09 19 50 17") ](https://www.youtube.com/watch?v=ZyA8JGDlU-o)

This also happens in the simulation tab in the widget blueprint editor.  
How do I fix this?

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [August 10, 2022, 8:40pm UTC](https://forums.unrealengine.com/t/umg-widget-blueprint-canvas-is-not-set-correctly-for-the-first-frame/625751/2 "2022-08-10T20:40:17Z")

</div>

Sounds like a job for Force Layout Prepass. Add the node to the Construct event and target the container that holds the buttons.

See if that helps. Not 100% certain this is the solution but it’s worth trying.

* * *

Alternatively, you could wait for a frame and then show the widget.

---

<div class="post-metadata">

**Author:** ![pblpbl](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@pblpbl](https://forums.unrealengine.com/u/pblpbl)\
**Post date:** [August 11, 2022, 2:26am UTC](https://forums.unrealengine.com/t/umg-widget-blueprint-canvas-is-not-set-correctly-for-the-first-frame/625751/3 "2022-08-11T02:26:33Z")

</div>

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)](https://issues.unrealengine.com/issue/UE-137604)

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [August 11, 2022, 9:14am UTC](https://forums.unrealengine.com/t/umg-widget-blueprint-canvas-is-not-set-correctly-for-the-first-frame/625751/4 "2022-08-11T09:14:06Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![pblpbl](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@pblpbl](https://forums.unrealengine.com/u/pblpbl)\
**Post date:** [August 11, 2022, 2:35pm UTC](https://forums.unrealengine.com/t/umg-widget-blueprint-canvas-is-not-set-correctly-for-the-first-frame/625751/5 "2022-08-11T14:35:55Z")

</div>

I’m not using a scale box but i just tried and it doesn’t fix the problem (neither does calling prepass before adding it to the viewport).

---

<div class="post-metadata">

**Author:** ![illYay](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@illYay](https://forums.unrealengine.com/u/illYay)\
**Post date:** [November 21, 2022, 5:47am UTC](https://forums.unrealengine.com/t/umg-widget-blueprint-canvas-is-not-set-correctly-for-the-first-frame/625751/6 "2022-11-21T05:47:14Z")

</div>

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.
