why is this destroing all enemys instead of just one?

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • Hey ppl! Need your help ... PLEASE T___T
    Please login to see this attachment.

    why is this destroing all enemys instead of just one?
    it should be only when hp <= 0
    when the destroy enemy was in 22 it killed only one
    already tried with foreach ....

    can anyone help?

  • you could try removing that second Collision condition.

    Enemy HP <=0 will suffice as the condition and Fusion will automatically scope and destroy the correct object without the need for the bullet colliding with the enemy condition.

    Check out my Game on Itch.io
    Please login to see this link.

  • The events are getting generalized . Although I don't really see anything wrong there. But you might want to try removing the collision condition from the hp <= 0 event. As the above event would set its HP to 0 or lower eventually making that event true and destroy it without with that condition anyway. Maybe thats whats generalizing it. You could also use the debugger to ensure that all enemies have their own independent values for HP.

    Edit: DaveC beat me to it.

  • Hi! thanks for your anwsers :)
    i tried without the collision detection, and tried in a foreach loop it happens the same.... if i move the destroy to line 22 all goes well...
    they have independent hp , all start with 20, if they get hit they get -10 . if one gets hit is hp is 10 and the rest is 20...
    I don't understand this behaviour ...

    Edited once, last by krezix: miss a word (October 17, 2016 at 6:47 AM).

  • A) as the other said, remove the collision event.
    B) I would double check your object values, sometimes i miss to either change the value or set the correct amount. Is your HP set at 20? Is the Damage of the ship at 10 or -10? etc.

    Please login to see this link.
    Please login to see this link.|Please login to see this link.|Please login to see this link.

  • RhysD
    thanks for the example loved the scale effect.

    danworth
    the problem was indeed in bonus loop , but doesn't understand why since the onloop was inactive ... but it's SOLVED :D

    zip2kx
    it's solved... maybe the problem was calling start loop that doesn't have a onloop ... since when i removed the call to BonusLoop it worked again .... what is strange because line 23 was a copy of line 22 initially -_-

    Thank you all :D

    Edited once, last by krezix: didn't saw zip2kx anwser, sorry (October 17, 2016 at 2:11 PM).

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!