c++ to blueprints, what target?

Hey all, I have an Actor iterator function in c++, like this one:

A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine ForumsObject%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:

  1. The function is static
  2. 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