Shooting only when actor is in the same row

I tried to do this many ways, any help.
Here is what I'm currently trying:
Put invisible actor on each row stretched to fit. If enemy overlaps it, the change attribute, row 1 enemies to 1. I did this for every row.
I want it to shoot only when there is an actor in the same row. And, the "gun" is spawned in different rows. Is there any way where I can use the same gun actor for all rows and to determine in which row the gun is in and so I can have it pick up the other attribute to make it shoot or not?
Here is what I'm currently trying:
Put invisible actor on each row stretched to fit. If enemy overlaps it, the change attribute, row 1 enemies to 1. I did this for every row.
I want it to shoot only when there is an actor in the same row. And, the "gun" is spawned in different rows. Is there any way where I can use the same gun actor for all rows and to determine in which row the gun is in and so I can have it pick up the other attribute to make it shoot or not?
Comments
In your gun actor, have the behaviour:
Constrain self.positionX to PlayerX
(playerX is a global variable)
In your enemies, have the rule:
If self.X = PlayerX
Then change attribute "Shoot" to true
Otherwise Shoot = False
In your player, have a rule that says:
If Shoot = True
Spawn bullet
And in your bullet just have a move to the right rule.
Does that help?
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io