GetUserWidgetComponent returns None on Begin Play

Today I Updated my project to 4.21 and started getting the following error that I wasn’t getting in 4.20:

In a WidgetComponent child blueprint I’m calling the function GetUserWidgetObject and is returning None right when the game starts:

Is this a bug?

[Test Project][3]

That’s because when the actor received the begin play, the widget hasn’t finished being created yet. Widgets can only exist at runtime. So you need to give it a frame or two before it actually exists.

What you’re getting is expected behavior.

Adding a tiny delay is the way to go.