I’m building out a Character Profile type of screen. I have lots of widgets here bound to data. How my bindings are set up is as follows:
I have all the data I want to display in my Character Profile Widget Blueprint inside a Data Table
Within a GAME INSTANCE blueprint I created and assigned to the project, I created a FUNCTION called “Get Character Data” that extracts the appropriate data from the Data Table (so I can then bind it to my widgets).
When I built this out initially, everything works as expected.
HOWEVER, if I CLOSE OUT my project, REOPEN IT and then COMPILE, I get all the errors seen in my screenshot below.
I don’t understand why I’m getting those errors!!! IS THERE AN EASY WAY TO FIX THEM ALL UP?!?!
I CAN “fix” them all up by manually rebinding ALL of my widgets (30+) to the exact same functions they’re already bound to…so this all makes no sense to me why I’m forced to REBIND all my widget bindings upon re-opening my project.
Hmm… that is crazy! Maybe they aren’t able to get your game instance for some reason?
Try hooking the game instance cast to the on construct of the widget instead of doing it inside all the binds. Then run that variable through an Is Valid check when you use to to get the information for the binds.
Well, try unhooking one of your binds and putting in a print string instead. Then at least we will know if it is the way the widget is set up or if it really is just something with getting the game instance.
EDIT: Oh…wait. If it doesn’t compile you can’t play test it now can you? Let’s think about this a bit more.
Maybe do hook in the print string to one, and at least see if that single one gets a compiler error.
-Make sure you have the correct game instance set in the project settings
-Get the game instance from the player controller and then get the player controller’s version of the game instance on construct of the widget. I don’t know if that does anything at all, but if for some reason it can’t get your game instance maybe it will get that one.
-Hook is valid into the final output (the struct itself in the case of your screenshot) and see if that gets one of them to compile.