Actor Spawning Logic Using Array Data

UPDATE: Okay, so I’m looking to create some logic in a blueprint to spawn actors based on how many actors are “marked” in my level.

I created my effect in Niagara and attached it to an actor with currently zero information inside. In my level I have created a few actors which count as receivers. I was going to use VInterp nodes to move the actors to the location of the receiver actors.

In the actor that spawns my effect I have a delay node → get all actors of tag (receiver) node → For Each Loop (with the actor of class return value as a [make array] ) → spawn actor (spell).

So far that has gotten me to be able to spawn the required number of effects into the level in a stationary position, but when I want to move them I don’t know how to make them fire off at the different receiver actors and not break down.

I’m not sure where to go from here but I have a few questions.

Is there a way to have the receiver actors be an individual instance in an array instead of being their own actors? ex: Receiver, Receiver2, Receiver3
^ That’s how they show up in the outliner.

Is there a way to get each spell actor to detect its proper receiver, or detect one that hasn’t been taken that has the tag?

Thanks for any help and input I’ll try and update more if I figure something out.

With the help of the internet and probably really bad code I came to a solution.

Here’s how I solved my issue.

I have (currently. the effect is not finished) 3 actors created in blueprints.

Actor A: Spawns the actor that carries the effect.
Actor B: Is the effect and travel.
Actor C: is the receiver of the “ability”

Inside of Actor C I created a tag called receiver.
Inside of Actor B I created a variable called TargetC made it a single object reference and referenced the Receiver. (Actor C) I checked expose on spawn and instance editable.

Here is the logic inside of Actor A.

This is handling the assignments of each of the Actor B nodes.

After the delay it gets all of the actors with the tag “receiver”. Then runs across a for each loop to create an Actor B for each receiver tag or Actor C. I used a “cast to” node to get the array element of each loop into a usable object reference. ( I need to learn more about this, I don’t full understand it but it works. ) Then after casting I spawn each actor based on how many receivers are in the level and connect the reference to my variable TargetC.

From my understanding this assigns each spawned Actor B to its own Actor C and considers how many are in the level.

Here’s how I got my “doodads” to move towards their desired location. (Actor B Logic)

From my event tick I check to see if the object TargetC is valid. (This is also Actor C, or the receiver actor.) I also get the location of the actor for later use. Then I use a Set Actor Location node and reference itself because this is the actor that carries the effect inside. I use a VinterpToConstant node connected to the event tick delta seconds and an interp speed of 500 to move the actor across the screen. ( I want to return to the movement to make it maybe better? )

I use the current location of the actor and the location of the target actor to keep it updating from its existing location. I checked sweep ( I saw this done once and didnt question it. ) Unchecking sweep doesn’t seem make a difference in the movement. I use an equal node and set the current location of the actor and the target to it. This will return true when the actor reaches its destination and then from the connected branch node gets destroyed.

I have a few more components I want to add to this, and still appreciate any feedback on the logic used here. Thought I’d update with what I got to work so far.