Destroy one Particle and keep the rest?

  • Hey guys! I'm having some trouble with multiple instances of particles....

    I have a Fireball with a Particle trail (smoke).

    after 10 "bounces" the fireball is destroyed along with its particle.

    BUT....

    If there is multiple Fireballs on the screen, there are multiple particles as well. When the first fireball to reach 10 "bounces" is destroyed all the other fireballs loose their smoke trail.

    How do I keep the rest of the smoke trails OR do I just allow only one fireball out at a time?

    Thanks in advance, you guys are always a huge help.

  • Store the UID of the fireball or of the particle in an instance variable of the fireball/particle and pick it before applying the destroy action.

    You can find more about this in the how do I FAQ section "Picking/Selecting instances".

  • Thanks for the reply! But....

    lol after 2 hours this is what is happening.

        ->Mouse On Left Click > spawn Fireball

                                spawn Smoke

                          set "fbid"(variable inside Fireball) to Smoke.UID                     

    After 10 collisions with solid.....

        Fireball "bounces" <= 0

            Smoke Pick instance with UID "Fireball.fbid" > Destroy Fireball

                                                           Destroy Smoke

    It works great with 2 Fireballs out. But if I put out 3 or more when the first one gets destroyed, ONE, and only one of the other fireballs looses its smoke, UNTIL another fireball is destroyed.

  • I'm a total noob so I'm probably completely wrong but couldn't it have something to do with the order in which you destroy the objects? If the smoke uid is stored inside a fireball instance variable, then couldn't it be lost before the smoke gets destroyed?

    Again, I know nothing but it might be worth it just to switch the orders there. I dunno if the picked instance is lost if the object that holds its uid is destroyed :/

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Rockin' idea Cliffman, Thanks!

    But alas, it's still dropping the smoke off ONE fireball for some reason. I'll keep at it though. Thanks again for your reply, it was sound advice.

  • Can you post simple capx?

  • dl.dropbox.com/u/68726261/Bounce.capx

    there is the link, sorry. took me a bit to get the dropbox thing set up and all. Thanks again for the help.

  • u must pick exacly the particle u want to be destroyed.. use the pick function, that might help you ;)

  • I did use "pick". if you check out the capx just above you. like i said, it works as long as there are not 3+ fireballs on the screen. best i can tell is it is a bug/glitch of some kind. Thanks for the response at any rate..... back to the grind. lol

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)