Creating multiple istances of Object2 on every istance of Object1

Hi everyone, I’m tring to create every 0.5 seconds object1 and at the same time
create object2 that have to spawn on every object 1 and follow them.
This happen only in the first creation.
When the first object1 hit the groud (and deleat himself), the first (and only) object2 spawn on the second object1 and so on.
How can i make it work ?
I’ve tried using object variable id in order to mark every object1 istance, and for each events but i can’t do it.
I have no problem if there is only one object1 in the sceen.

Well I don’t understand the logic here and the Object naming gees do you understand your game everything is called obj1 obj2 , variable C, how do you understand what does what. Anyway according to the creation if you delete the Obj1 the Obj2 is never going to be created as is a dependent of Obj1.

So to fix that you need to create the obj2 before and hide the obj1 instead of delete the obj1 try to add an event where you create both even if the obj2 is not used later.

And plus for every x seconds there is an extension super helpful to do that kind of events and you don’t need to use timers anymore.

Thanks for your response.
I upload an image of the game and update objects and variables names, hope it is clearer.
The Big Ball runs across the red path while shooting the smoller Pink balls (Pink Bullets).
The method I used assigns a number to every PinkBullet, in this way i should be able to apply the action: “Create Parry Point” to every PinkBall, verifing the number of the Ball.
Every Pink ball must have one Parry Point (the small red ball).

Did you try to move the event Put ParryPoint as a subevent of the foreach?

I ask this because when you call the event put around you try to set ParryPoint around PinkBullet but since is not inside the foreach to which Pinkbullet should be put around?

I don’t know if is this what you want check this project.


Your project is perfect !
I haven’t understood the “link two objects” action and the “take into account” condition, but I think it won’t be difficult.
I’ve tried creating a subevent for the action “Put ParryPoint” but I think every frame the program need to update the position of every PinkBullet in order to move every ParryPoints. I would nedd a Put ParryPoint “Permanent” action, in this way i associate the action “Put ParryPoint” once for every ParryPoint.

Yes that’s exactly which framed events do the link two objects is for you to link ParryPoints to PinkBullets without the need of add variables and counters. When you link two objects you can check inside a loop is there is one or more object linked to your target object and act in kind.

1 Like