Missile Smoke Trail

Get help using Construct 2

Post » Mon Jul 09, 2012 9:28 pm

I'm trying to make a missile that uses a particle smoke trail.

So far, the game creates the missile sprite and pins a smoke trail to it, but when the missile is deleted, the particle stays where it is.

How do I delete the particle object?

Or is there a way I can group several objects into one object, so I spawn and destroy them all at once?
B
13
S
4
Posts: 117
Reputation: 2,242

Post » Mon Jul 09, 2012 11:04 pm

Add an instance variable to your particle object. When the particle is created, save the missile's UID in that variable. Then, when you destroy the missile, destroy the particle with the corresponding UID saved in it's variable.

Quick .capx:
ParticleParent.capx (r98)
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Tue Jul 10, 2012 1:04 am

Thanks!

Is there a way I can delete the particle object without causing all of the particles onscreen to disappear immediately?Zero62012-07-10 01:05:14
B
13
S
4
Posts: 117
Reputation: 2,242

Post » Tue Jul 10, 2012 1:28 am

Did you check out the example .capx in my previous post?
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Tue Jul 10, 2012 1:40 am

I think I worded that wrong. :P

I meant, is there a way I can delete the particle object without the smoke trail disappearing immediately?
B
13
S
4
Posts: 117
Reputation: 2,242

Post » Tue Jul 10, 2012 2:30 am

Oh, haha, sorry I misunderstood. I see what you mean now, you could for example use the fade behaviour, like so:

ParticleParentFade.capx (r98)
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Sat Apr 30, 2016 12:16 am

Nimtrix, thanks a lot)
B
5
Posts: 10
Reputation: 249

Post » Mon May 02, 2016 3:12 pm

Would not it be easier if you simply use container? So when you delete the missile, the smoke trail would be deleted too :)
Image
B
26
S
9
Posts: 71
Reputation: 1,803


Return to How do I....?

Who is online

Users browsing this forum: Justin1967, Yahoo [Bot] and 23 guests