User Tag List

Results 1 to 5 of 5

Thread: For each loop question

  1. #1
    No Products Registered

    Join Date
    Sep 2014
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,159
    Mentioned
    28 Post(s)
    Tagged
    1 Thread(s)
    Can you post a small example?
    I'm sure guys here will be able to fix it

  3. #3
    No Products Registered

    Join Date
    Sep 2014
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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?

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,159
    Mentioned
    28 Post(s)
    Tagged
    1 Thread(s)
    Taking from the example you linked,
    here's a modified version:

    closestwithforeach_1.mfa

    (you no longer need the "external" foreach object, as it's been embedded in fusion,
    you don't even need extra objects)

  5. #5
    No Products Registered

    Join Date
    Sep 2014
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ahh thanks for taking the time to make this.. Didn't know fusion had this build in.. This is what i needed thanks!

Similar Threads

  1. Loop fade in and out question?
    By Bree in forum Fusion 2.5
    Replies: 2
    Last Post: 3rd February 2015, 01:48 AM
  2. Newbie Loop Question
    By Ziplock in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 11th November 2013, 02:48 AM
  3. Loop Question...
    By Orpa1 in forum Multimedia Fusion 2 - Technical Support
    Replies: 11
    Last Post: 25th July 2009, 05:35 AM
  4. Loop question
    By maVado in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 21st May 2009, 02:21 AM
  5. Yet another Loop question
    By Doc4 in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 24th November 2007, 03:01 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •