antithing
(antithing)
April 13, 2015, 11:12am
1
Hey all, I have an Actor iterator function in c++, like this one:
A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums Object %26_Actor_Iterators,_Optional_Class_Scope_For_Faster_Search
Where I add all actors of a class to an array, then call the array from inside a UMG HUD blueprint graph. It won’t run as the c++ node is ‘target, self’.
What SHOULD I have as the target for it?
thanks!
I know this is an old thread, but in case someone else is looking for the answer.
In the header file, make sure:
The function is static
In the UFUNCTION() you added a meta = (HidePin = “WorldContextObject”, DefaultToSelf = “WorldContextObject”)
Example:
UFUNCTION(BlueprintPure, Category = "Variables", meta = (HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject"))
static FString GetString();
Note: You probably need to add public: one line beneath GENERATED_BODY(), which you didn’t need to do before you made the function static