Displaying multiple instances of a sprite?

Hey, first post on here, sorry if it’s not in the correct format! I’m pretty new to GDevelop too.

I’m trying to make a retro-style top-down shooter (like everyone else apparently) and I can’t seem to get my turrets to work properly.

I’ve set them up as three separate objects, one is the main turret that everything else is linked to, then the gun shafts, that rotate to follow the player. They only rotate if the player is in collision with a cone of vision from the turrets.

In the scene editor I bring the turrets in from the objects panel, then, to bring the gunshafts and collision check into the scene I create them in events, at a specified position to the turret sprites. My problem is, only one will work at a time. When I place multiple instances of these objects, only one will appear when I launch the game. What am I doing wrong?

Thanks in advance!

Update, rookie mistake, I’ve messed up the Z layers.

Multiple turrets will show now, but gunshafts will not spawn at individual instances other than the first one.

Hi and welcome!
I would try “all shaft linked to turret” or “repeat for each shaft” instead.

Hey, thanks!

This is what my events sheet currently looks like, I think this is what you meant?

It is still producing unwanted results; only the first placed turret will function properly. The other shafts of turrets placed within the game window will also spawn, but they will not move with the turrets, instead staying still and not reacting to player movement. Another small thing is that the turrets placed outside of the game window will not spawn in at all, even when the layer moves on screen.

Is there a way I can upload my save file?


Not exactly, I said to try one or the other.
Aside from that, I think you should be more explicit about which enemyVision you mean. Do these work as expected?

I think the correct syntax is:
Repeat for each object you want the actions to apply to:
Take into account all the “otherobject” linked to that object.
Take into account all the “otherotherobject” linked to that object.

You can upload your file to any file host you like and share the link. But it’s better for everyone if you find the issue yourself. :wink: