Hi,
I was just testing out some Blueprint communication between a Character Class and a UMG Widget.
In the ThirdPersonCharacter Class I have a variable, Object Ref, that holds a reference to a created UMG Widget (called “File”).
I want this File Widget to appear onscreen when a Button is pressed. So I cast to the Character and get the Object Ref in order to run the add to viewport node.
That all runs fine actually. If I attached Object Ref to Add to Viewport, the Widget appears onscreen exactly as I want.
However, the one thing I can’t seem to get right is having Object Ref pass its value into another Variable.
In the image I’m setting NewVar_2 to Object Ref’s value, but when I do that the Add to Viewport node won’t run.
What’s the reason for that? NewVar_2 is of the type User Widget, and, again, Object Ref by itself is able to successfully create the widget, yet I cannot seem to find a way to set a variable equal to the value of Object Ref.
I have it On Initialized here, but I’ve tried it with Construct, Pre-Construct, and in Functions as well.
Am I missing something about how these object references act, and whether or not one can set another variable to their value?
Any help is appreciated, thanks.