Download

Adding targets to the array and remove then?!?! (help+images)

Hello Guys, I m never play with ARRAY before and right now in the middle of a roadblock.
I got a NPC that shots another NPC. For this I have attached ChildActorBP with Turrets inside SHIP A and trying to make then shooting at SHIP B; I have try this calling ALL ACTORS OF CLASS and make a VARIABLE for this and make the actor “target”;

I TRY THIS

And read from this ARRAY…

… and update range for shooting with the TICK with this…

This works for ths first TARGET; When this target is “destroyed” I got a lot of errors with this…

Then I try this:

I try to SHUFFLE or REMOVE to ADD again with no success… I super noob sorry and when I try to do thie with no ARRAY, when the first target is destroyed the guns stop looking for another target…
What Shoud I do?! 36hours on that… :stuck_out_tongue:

Thank u
Mauro

You don’t seem to be adding anything to the array apart from the last element, I think. Start with this and see if things improve:

Capture.PNG

Wheel, this could help me! Thanku . But I still in the middle of roadblock… :slight_smile: I can add to array the target using get all actors from a class. But when he gets destroyed the array seens do get lost and I need to clear de array and try to get new target to array again… doing this I got that errors… like this:

PIE: Error: Blueprint Runtime Error: “Accessed None trying to read property CallFunc_Array_Get_Item3”. Blueprint: RailGunAttackCycleTarget Function: Execute Ubergraph Rail Gun Attack Cycle Target Graph: EventGraph Node: Ramificação

Best regards!
Mauro