Hello everyone, I have a widget that calls a function on my character’s BP, the function has a ‘Widget Reference’ input so that I can access my widget’s properties from my character, I pass the ‘Get Reference to Self’ from my widget when calling the function, but the game can never seem to access properties of the widget, I always get errors like ‘Accessed None from Widget’ I have tried quite a few inputs: User Widget, Inventory(the widget), but my character can never properly access the properties, which forces me to use individual properties as inputs, so how can I properly reference my widget from my character if it is not created via character?
Edit: This works fine on the server, but not the client.
BP/C++? Try a get all widgets of class or get all widgets with interface. Do you have a function in your character you call on widget construction that sets a reference var to the widget?
Some pictures would help get a better idea of what you’ve got setup.
This is all in blueprints. In further detail, my player is spawning an inventory UI, and the inventory spawns several buttons. When I click a button, I am trying to pass my button’s widget to my character’s function that I am calling so that I can access my button’s variables, but this isn’t working. I have tried passing my widget as the return node from creating it, and as the ‘Get Reference to Self’. Here are some pictures, picture 1 is me spawning the button from the inventory, picture 2 is the On-clicked for my button, and picture 3 is the event in my character BP. I previously mentioned that this worked fine on the server, but I might have been mistaken now that I am testing it again.
Running against the same error. Have you found a way to make widget references work? In my case I’m spawning widgets on top of a master widget that references every object when created before adding them to the viewport. It is supposed that by doing this the variable gets stored in runtime, so whenever I need this variable again the reference should be the one already stored but is not. I had to use cast to nodes but I suspect things will get messy pretty quick with so many spawns.
The info inside the ue4 documentation is a bit blurry when it comes to object references and UMG.