In short I need it to take ANY actors with that “Priority Target” tag regardless of the Index in the array.
The Image sums up the details real short
In short I need it to take ANY actors with that “Priority Target” tag regardless of the Index in the array.
The Image sums up the details real short
You can use a “ForEachLoop” node to iterate over each item of an array. You can then process them individually (manipulate them, check for tags and stuff)
And that’s what the node GetAllActorsWithTag does. It returns all actors with that tag. You do now want to iterate over the array to get the distance to each actor. So you need a loop. The easiest would be a ForEachLoop here.
Ok tried that so the breakdown this happened
“Target Array” (Output pin premade array from “Get All actors with tag”) is invalid.
I even tried the “ReverseForEachLoop” to see if someone how that would work but that wouldn’t of made sense to begin with but hey…I’m reaching
Here’s some pictures…
Inside the “ForEachLoop” pre made node
][2]
Target Array is not the output pin from GetAllActors with tags, but the Input Pin for the Loop. But it looks like they are connected. Try deleting the loop and spawning the node again. The OutActors pin has to be connected to the Array input of the loop. I just tried this myself and it works fine for me.
Ok tested it its not the connection between “Get All Actors With Tag” and “ForEachLoop”
Its the of “Array Element” output pin of “ForEachLoop”
and “Other Actor” input pin of the “Get Distance To” node causing the failure to compile
Im sorry, but I don’t spot a mistake, and can’t reproduce the error. I literally stuck the nodes exactly together as you did, but it just worked for me. The error message is also very strange if the GetDistancTo node causes the issue. It mentions an array which makes no sense in that case.
Alright after some fiddling and replacing nodes breaking links and such a found Villious…
You see that “Return value” output pin from the “Get Distance To”
Yeah that plugs to a Float>=Float node, that’s what did it…That’s a first…
I’m gonna need to read the documentation now to see if I’m not quiet understanding exactly what “GetDistanceTo” does but I will state it worked before I tried adding the “Get All Actors with Tag” and compiled nicely
Ok I have solved it!
This is not at fault of anyone you did not have the information to get at what was apparently causing the issue.
From the “Get Distance To” “Return Value” output node was a Float>=Float node thats Boolean output pin was connected to a “InRange?” Output MACRO…It didn’t like that
It used to be a branch outside the macro that checked it if it was true or not, but by putting on the inside and instead changing the “InRange?” to a Exec Output Pin its all happy now
It in all its completetion now looks like this…
Glad you solved it yourself.
However I guess you’re not correctly understanding what went wrong. The nodes GetAllActorsOfClass and the ForEachLoop were never executed and therefore the actor wasn’t set. If you would’ve plugged the LoopBody output in the Output node of your macro and executed the macro before your branch this would’ve worked.