-
For each loop question
Hi there,
Im having a problem.. Im making a game with Friendly AI and Enemy AI. I want them to shoot eachother and im getting stuck on this: I have a for each loop that detects the range of an enemy for a friendly object and target them. this object can destroy them one for one.. but when i duplicate the friendly only one of the friendlys detect and kill.. the other ones dont.. anyone knows how to fix this? Do i have to make another for each loop or something so different friendlys wil check the distance and target them? Maybe im not explaining this right..
Wes
-
Can you post a small example?
I'm sure guys here will be able to fix it :)
-
Thanks for your reply.. Im using this example.. castles-of-britain.com/closestwithforeach.mfa What i want is to clone the object that is targeting the closest "enemy" and let them target the closest "enemy" individualy. I dont know how to aproach this in the best way?
-
1 Attachment(s)
Taking from the example you linked,
here's a modified version:
Attachment 19549
(you no longer need the "external" foreach object, as it's been embedded in fusion,
you don't even need extra objects)
-
Ahh thanks for taking the time to make this.. Didn't know fusion had this build in.. This is what i needed thanks!