This UMG widget has a bunch of nodes in the event graph which makes sure its facing the player however i need to make sure this UMG widget has a reference to the ‘AStar’ actor that its supposed to be associated with.
In order to do that i need to set that AStar variable in the UMG blueprint from the AStar actor class in C++.
Now i know i cant set the variables directly well ive pretty much exhausted all options to try and do this none of which work.
So i was thinking of using the CallFunctionByNameWithArguments
So i created a function in the UMG Blueprint like so
Create a blueprint child of AStart Actor, and spawn the widget in blueprints, set the variable there.
Then you could spawn a static blueprint class by name or the class that creates the AStart actor can also have a blueprint version where you set which class to spawn. So the C++ spawner just spawns “that class”
Create a C++ parent for the widget so you can crate and access its variables in C++, then just parent your widget to it’s new C++ parent (the parent class should be of type: UUserWidget)
Then spawn the blueprint version, but with a reference you can still access its C++ parameters. as long as you cast to it parent.