I often create Active objects as part of an effect, and destroy them rather quickly. Sometimes if I spam these effects rapidly, the active objects will just kinda get stuck on the screen. I've had this issue with loads of projects over the years, so I'm sure others must have encountered this. It's usually when I create an objects, then destroy it after it's animation has finished.
I know it may be difficult to judge based on this vague description, but have you encountered this, and found a way to correct it?
Instead of relying on completed animations to trigger the Destroy action, I use an internal counter in the form of an Alterable Value.
I've been trying to structure my events in separate groups per object. So say for example I have a group labeled "debris" which deals with everything related to the chunks of bricks leftover from explosions.
IF Always
THEN Add 1 to Alterable Value A of "debris"
IF Alterable Value A of "debris" is Greater or Equal To 100
THEN Destroy "debris"
One other interesting thing you can do is link an object's transparency to an Alterable Value so you can manipulate its transparency during runtime. In those cases, Destroy the object after Alterable Value A is greater than 128 so the object is Destroyed only after the object disappears.
EDIT: Oh! And if you don't want your objects to be Destroyed all at the same time, then change the first Event to this:
IF Always
THEN Add Random(5) to Alterable Value A of "debris"
Originally Posted by -Liam- I often create Active objects as part of an effect, and destroy them rather quickly. Sometimes if I spam these effects rapidly, the active objects will just kinda get stuck on the screen. I've had this issue with loads of projects over the years, so I'm sure others must have encountered this. It's usually when I create an objects, then destroy it after it's animation has finished.
I know it may be difficult to judge based on this vague description, but have you encountered this, and found a way to correct it?
I only ever use the bouncing ball built-in movement for particle effects, but in my experience, objects aren't destroyed if the object is also using a built-in movement and is moving. If the objects are "launched (at speed x)" they won't respond either.
Thanks for all the info guys, I really appreciate it! It's good to know it's a common bug. Well, it's a bad thing really, but at least I know it's not just me!
I use either an internal value or only put graphics in the disappear animation, then it'll initiate with that animation and automatically destroy itself when it's done. I can't recall that being buggy.
Originally Posted by Eternal Man [EE] I use either an internal value or only put graphics in the disappear animation, then it'll initiate with that animation and automatically destroy itself when it's done. I can't recall that being buggy.
I do the exact same thing and haven't had a problem yet.
i used to have this problem all the time and it drove me insane. as everyone else stated if you have it destroyed at the end of the animation it tends to get stuck. ive also had it where it basically pastes part of the sprites onto my background and thats just really strange looking and kind of annoying lol. using an alterable value is what ive found to be the best way to fix this problem. ive not tried the other way they said by putting it in the destroyed animation but honestly i think it would be better to use an alterable value that way you can control easily how long the particles or chunks stay on screen before getting destroyed.
[Game design makes my brain feel like its gonna explode.]
I'd say it's a question of efficiency/simplicity and how you want it destroyed.
Having only the disappear animation filled is the most simple, efficient way. It gets the job done without a single event. However both ways should be used depending on what you want; the animation dependant way will always destroy after a set TIME(since animations follow timers not ticks) whilst the value dependant way will destroy after a set NUMBER oF TICKS. So depending on what you want you'll switch ways.