Creating multiple particle objects at the same time

So I have 3 differant fireball sprite objects with three different names being created on the fifth frame of another objects amamation and they have a variable that adds a force. It took a while to figure that out because I wanted them to move at different angles. For some reason all three would follow whatever was on top in the list. I had to set a timer and have them launch .1 second apart. Anyway, after I got that to work I wanted to create 3 particle objects to follow. So I created 3 different particle objects in the same event and had a constant event to track the position of each fireball. It works one time. After that it just shoots fireballs without the particles. While I was messing around trying to get it to work, I set a timer to delete the particles after 1 second. The particles would work every time. So I thought I could time it up with the reoccurring fireball event but I can’t get them to recycle the event if they move off screen.

I think it’s just buggy because I have a lot going on in the event. Is there a better way of doing it?

I simplified the event to try and work this out. I deleted two of the fireballs. Still, with only one ball firing, the particle emmiter only recognizes the event the first time. Is the particle emmiter bugged or should I not expect it to act like others objects?

Hi, in your first event you should link your Fireball with the emitter (with the ‘link two objects’ action). When you move your emitter you need to use a ‘For each’ event for the emitter and as a condition you have to ‘take into account all FireBall linked to emiter’. This should move your emitter with the FireBall.

Here is a quick test project that shows what it looks like:

1 Like

Thanks for the response. I’m learning something new every day. Haven’t used link objects yet. Will definitely try this now. Also, I was messing around with it today and found the copy and object multiple times action. So I have the fire ball actually make 3 copies. Is there a way to have copies of the particle emmiter and have them linked to the copies of fireballs.

To give you a better idea what I’m trying to do. I’m making a Mario game and am trying to create the piranha plant that pops out the tube and shoots 3 fireballs. I have the timing and movement and placement worked out. I just need to get to emmiters to follow each fireball and have to plant fire in the direction of mario. Is that something I’m gonna need x raycasting for?

I don’t know what

is. I woud use a ‘Repeat’ event for creating your 3 fire balls. You can link and move the particles as shown in the example.

Raycasting is actually not necessary. For the plant to shoot the fireballs you could use the ‘distance between two objects’ condition (for example: if Mario is 100px or less to the plant, plant fires balls in direction of Mario).

So tried what you said but couldn’t get the particle emmiters to follow. Also, the repeat function spawns all three instances in the same spot. There’s a “copy object” action I messed with and got it to spawn 3 fireballs in the position I want them to start but they just get closer together as they reach their target. I want them to spread out and don’t know how to set position of multiple instances that are created at the same time. I’d like to force the top and bottom fireballs to the same position as the middle is going but would like to tweak the Y axis on them. One at Mario.y()-20 and Mario.Y()+20 for the other.

I got it to work using 6 different objects for 3 fireballs. I would have like to of used the clone action and not have so many different objects but I can’t get it to work.

Instead of using repeat or copy I would probably just create the fireballs separately and give each of them a different angle.

You have to keep the order of linking the objects, exactly as I posted it above.

If you post your events we can maybe figure it out.

If it works this way I would just keep it as it is. You can still optimize it later if necessary.