Particles with sprites

OK so I have An enemy which spawns every second. I have a particle emitter that emits behind it as it moves. How do I get each instance of the enemy to have an instance of the particles and have it update with the enemy’s location so the particles follow that instance around the map?

Cheers :slight_smile:
Benjy.

Hi, if you create only one enemy every second, you just need to create the particle emitter in the same event block with the enemy. To make the emitter follow the enemy you can add the sticker-behavior to the emitter and stick it to the enemy after creation.

Something like:

Hi,

thank you for the reply. That does work. I was wondering, the particle effect is a trail left behind, is there a way to keep that trail until it’s faded out? With this stick behaviour, it deletes it as soon as the enemy is killed.

Cheers,
Benjy.

By default that shouldn’t happen. In the sticker menu, is the ‘destroy when the object it’s stuck on is destroyed’ unchecked?

If so, something in your events may be the reason.

HI,

I checked that because otherwise the particle emitter just stays in the same spot once the enemy has died and never disappears.

Cheers again,
Benjy

In the particles emitter menu is a checkbox “Delete when out of particles”. Of course you need to set an amount of particles in the tank, otherwise an infinite amount will be created and the emitter is never deleted.

You could also add a timer to the emitter and start it after the enemy is destroyed. After a certain amount of time has passed the emitter is deleted.

1 Like

Hey, thank you for your help, I have managed to get it to do what I want.

Thankyou :slight_smile:
Benjy.

1 Like