Particle & Destroy Behaviour workaround?
JCFord
Member Posts: 785
I have an actor that when in contact with another actor I want it to create particles (explode effect) and then destroy itself - simple right?
The particle part works great on there own when it contact with the player, but as soon as I introduce the destroy behaviour it stops the particles from working?
RULE
Actor receives event - overlaps or collides with player then
Behaviour - Particles
Behaviour - Destroy
I have tried wrapping the destroy in a timer with a slight delay but it just stops the particles from working and I really need the actor to destroy and for there to be only particles.
Thanks for any advice.
Whats the way around this?
The particle part works great on there own when it contact with the player, but as soon as I introduce the destroy behaviour it stops the particles from working?
RULE
Actor receives event - overlaps or collides with player then
Behaviour - Particles
Behaviour - Destroy
I have tried wrapping the destroy in a timer with a slight delay but it just stops the particles from working and I really need the actor to destroy and for there to be only particles.
Thanks for any advice.
Whats the way around this?
Comments
If you want particles that stick around after the actor is destroyed, or a smoke trail that fades out after the actor is destroyed, and doesn't just blink off, you'll need to do it this way:
You need to create a separate actor that just contains the particles you want, name it myParticles or something like that.
You'll need to create two global game attributes called PlayerX and PlayerY ( or whatever actor needs the particles)
In the actor that needs the particles, add a spawn actor behavior, and spawn myParticles.
Here is also where you'll constrain game.PlayerX and game.PlayerY to self.PositionX and self.PositionY
In the myParticles actor, contrain self.Position.X and self.Position.Y to the global PlayerX and PlayerY
thanks for the advice.
Rather than generate a new actor for the particles which i would have to destroy at some point. I was thinking along the lines of using the change Atribute to make the actor invisible so it would just leave the particles, but then I need someway to disable the actor so it cannot interact with the player and produce more particles while invisible, and then after X seconds destroy it.....hmmmm
Oops. I just read what FireMapleGames just said...basically what I said in more detail. Oh well. :-)
Just remember to add a timer rule on the spawn particle actor that destroy it after the explosion.
(by the way I didn't constrain the positions)