Create object on every instance of another

I want to create an enemy object on top of every enemy spawning object, I tried the create command but it seemed to only create an enemy on top of one

Use a ForEach EnemySpawner subevent (right click on a blank area in the first event and choose it from the popup context menu).

I did that and it seems to be spawning an enemy for each spawner, but all in the same location. I used the “pick random” event and just ran it a bunch which technically works, but only like 99% of the time, and it takes a while to actually create all of the enemies.

Can you include a screen shot of the events?

When it’s like this it doesn’t work, when I change it to random it does (eventually), but with random it takes longer and causes some issues

No, you’re not using a ForEach event :

(BTW, this works - I’ve just tried it for myself)

And why are you using PointX(“a”) and PointY(“b”)? That chooses the X component of point named “a” and the Y component of point named “b” on your EnemySpawner object. Do you have these two defined? One would expect both point names used to be the same.

To answer your question about the whole “a and b” thing, I don’t really know how that part of the command works, so I just put random letters and can change them later if needed. Also where are you finding the “Repeat for each instance” command. We may be on different versions, as I can’t seem to find it anywhere

In that case, leave them out, and just use X() and Y() for now. The point names refer to points that you can declare on your object.

As for the ForEach:



Thank you very much, it worked flawlessly, thanks for letting me know what that part of the command does, could be very helpful in the future. I appreciate you using you time to help me, have a good day : )

1 Like