I have two widgets:
-WB_MainWidget
-WB_HeroSlot
Variables in MainWidget:
Player_Gold (set to Instance Editable/Expose on Spawn)
Text_CurrentGold (is a variable)
HeroSlot is a child of MainWidget:
I currently have text variable named ‘Text_CurrentGold’ and a ‘CurrentGold’ Int variable on the MainWidget
In the child widget HeroSlot,
My problem is that when I click the button in the HeroSlot widget, the text variable ‘Text_CurrentGold’ in the parent becomes invalid. What i want to do is have the ‘Player_Gold’ set the text to the parent ‘Text_CurrentGold’.
Error when testing by clicking the button:
PIE: Error: Blueprint Runtime Error: “Accessed None trying to read property Text_CurrentGold”. Node: SetText (Text) Graph: EventGraph Function: Execute Ubergraph WB Hero Slot Blueprint: WB_HeroSlot
Im confused because in the Main Widget, ‘Text_CurrentGold’ is valid when i add some print strings to the ‘isValid’ node after EventConstruct:
Thanks in advance for any help and let me know if you need any more information!
-Ara
EDIT: Solution. Kicking myself. I needed to add a GET ALL WIDGETS OF CLASS in between setting the INT variable PlayerGold and setting the text Variable