How do I give a gun to multiple instances of enemies?

I’m trying to give my enemy objects a gun but what happens is only 1 enemy instance gets the gun and if the enemy holding the gun dies then the gun from that enemy is then moved to the next enemy instance, what I want is every enemy instance gets the same gun.

the yellow circle is the gun and as you can see both orange circles represents the enemy and as you can see only 1 is holding the gun and what I want is that all of them should be holding the same gun.

If you don’t need enemy to have gun as separate object
And i assume you don’t
Make enemy object your gun from which you fire bullets and now all enemies will fire bullets
You will need just to add gun to your enemy animation
And that approach would make a lot more sense events wise and performance wise
If you have multiple guns for enemies
Then making multiple enemies object with different gun animations would also make more sense

Other than that if you really need each enemy to have separate gun object
You would need to create gun object with creating each enemy
And then link that gun to enemy
On top of that you would need add condition to that event
INVERTED enemy is linked to a gun
So only ones that do not have gun linked to them get a gun
Then you would need to unlink a gun when enemy dies and while deleting enemy also delete the gun object

So as you see giving each enemy separate gun object would be a lot more work and i suggest you do not go that route but choice is yours

1 Like

But how would I go on by doing that? Sorry, but what you described is basically the problem I’m facing that I’ve posted, I want each enemy instance to have a gun object with them so that when the player is moving around they are pointing the gun to the position of the player, and I already have a gun object created, check the screenshot.

I’ve tried doing this and what ends up happening is that each enemy instance now has the gun but are not moving with the enemy, and I’ve put a trigger once condition so it wouldn’t infinitely spawn the gun but its not shown on the screenshot.