Can't communicate with widget component

Hello! I am experiencing problems when trying to create a inventory system with UMG.

I’m trying to put the widget as a component in my player character blueprint. The reason why I don’t just add it to viewport is because I want it to be in 3D space, to work with the stereoscopic view of the Oculus Rift.
Somehow when I drag of the widget component pin in my event graph and search for the variables in the widget class, I can’t find then… It does however work when I use a create widget node in my graph editor instead of the widget component. From that one I can reference variables. I tried everything I know of and I can’t seem to get it to work…

Any help will be greatly appreciated!
//Edvin

Just came across this question and wanted to tell you that to do this, you need to call ‘GetUserWidgetObject’ on your widget component reference first. That will give you a reference to the actual widget (which you need to further cast to your Widget class) and you can then access variables/functions there,

1 Like

Hello! At first I did just that and it simply wouldn’t work. Then after a long while it did start to work haha. But thank you for the answer!

I’ll add, I just had this issue. It doesn’t work in the construction script, but you can put it after “Begin Play”. Apparently GetUserWidgetObject is marked unsafe for construction scripts.