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?
asked Jan 03 '19 at 03:51 PM in Blueprint Scripting
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.
answered Jan 03 '19 at 04:13 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here