Spawn Multiple actors at target points

Hello , I have 5-6 Target points and i want to Spawn My AI at all of them when entering the trigger box , Right now i have got it working by referencing individual target points , But i am sure there is an easier way , I am super new to blueprint scripting
Thank you for your help alt text

all you really need is a reference to the targets you want to spawn at then use a loop to spawn a character at each one. the simplest way to script this is to use the get all actors of class node to get a reference to all the target points and output it into an array. you can then take the array and use a for each loop so for every target point it will run the script after. then just have a spawn actor of class. thats the basics.

now you may want to use other methods to create the array of spawn points such as using a public variable. this method would allow you to have a bp which contains the trigger then to associate specific spawn points for each trigger placed in the level. so if you enter trigger A then enemies spawn at points 1 2 & 3, enter trigger B though and they spawn at 1 2 & 5.

also by using a for each loop rather then making a script for every enemy you want to spawn your script becomes more versatile and reusable.

Edit: below is two examples i what i mentioned. the first one is very basic and will spwan one enemy at every target point in the level. the second method checks to be sure it was the player character overlapping, then gets the spawn points array variable which is public so it can be set on a per instance basis in the level details panel, before finally running the spawn actor between 1 & 4 times per target point. so basically when player overlaps spawn 1-4 enemies per spawn point in the array.

Put out of the first spawnshadow comment (without disconnecting them) all nodes representing something that change from spawnshadow to spawnshadow (for exemple blue nodes). Then select all other node in this comment (node that are redondent) right click and colapse to function. I think after doing that you’ll understand (ctrl+w for duplicate) . Also foreachloop can help.
Edit: Also the answer from ThompsonN13 is a way to go, but i think you need to understand function as first thing.

probably worth looking into event dispatchers.
here’s a link

also this is the best blueprint 101 tutorial in existence. link

also note i made these scripts in a actor bp so they can be reused as you see fit. you could use them in different levels or have many triggers placed in one level if you liked. if you only needed it for the one level then you could still make it in the level bp if you really wanted to.

Hie How can i make it that the AI’s Spawn at all the target points once and thats it , Not random target points

that’s what his method 1 is doing

Hiee Thank u so muchh , it worked outt , This really helps so muchhh

yea if you want to spawn at all target points in the level then you could use method 1 for that.

method two just shows another method and some optional bits that you can add. theres much that can be done to add customization or many ways to do the basic method your looking to do.

I am Sorry But one Last question how do i assign the AI Controller to them after Spawning , THis doesnt seem to work

I tried using the Get all actors from Class , but i cannot set The animation Mode back to the Bp
,how can i find a connection from the array to Skeletal mesh target,

drag off the array output pin and search for “for each loop” then connect the element pin to the skeletal mesh target.

How do i assign the AI Controller to them after Spawning

do your characters not have a ai controller by default? if they arent acting as they would if placed in the level then it may just be the ai default possession, basically theres a option that you need to set to “spawned and placed in level”, i odnt have unreal open at the moment so i cant say the exact option but itll be in the class defaults list 2 options below auto posses player.

how can i find a connection from the array to Skeletal mesh target

again something you shouldnt need to do, but the way you could do it if you choose to go that route would be to use a for each loop on the output array then get the skeletal mesh component off the blue array element pin on the loop. depending on your setup you may also need a cast in there to define which class your looking for (cast to character or your specific character class type)