First, you don’t want to declare a new array every iteration of your for loop.
Second, you don’t want to declare the array within your for loops scope (the curly brackets) because when the loop is done, the data goes “out of scope” and is removed from memory.
Third, you want to have a method which returns the array of strings. You can either return it as a function return value or as a function parameter by reference.
Once you’ve got a function which generates the list of names for your static mesh actor, then you can call it within the UMG blueprint to get the values and insert those strings into a scrollable text box. Don’t forget to set your UFUNCTION parameter to “BlueprintCallable”.
You’ll also want to double check to make sure that your “AStaticMeshActor” actually iterates over a list of mesh actors.
No, “void” means, that you have an “empty” return. In other words, you have NO return. If you want to return a TArray<FString>, then you need to put “TArray<FString>” instead of void into the definition and declaration.
Also if you declare the array in your .h file, you don’t need to create it in the function again.
If you make it EditAnywhere and BlueprintReadWrite, then you won’t need a return value. Your function will change the array with the loop and you can access this array in blueprints because of the UPROPERTY makro and its options.
So in the blueprint, i have the return value as an array. Do i need to use the ForEachLoopWithBreak to split the array values out? or is there a node i don’t know about?