Enemy not shooting while standing still ¨bug¨

in the game im making i dont know how to fix that when you stand still the enemy doesent attack you only when you have moved and your X coordinates are the same

and what is actually supposed to happen is that the enemy attacks you if your x coordinates are the same as the enemy and still attacks you if your standing still but this does not happen also how do i add multiple enemies because the code that i have now is [ move enemy to newsprite.pointX(¨origin¨);70 ] and that makes every clone that is named enemy walk there in one single spot and i know i can add multiple diffirent enemies but then it will be very cluttered and unorginized and im just looking for a better way also how do make it so when i have multiple enemies i can make then shoot to their own places without adding multiple bullet sprites just like the enemy sprites but the most important thing i need help with is the first thing i said about how if you stand still the enemy dosent shoot

this would be the code but gdevelop says i cant put more than 1 embed link
The x position of enemy = newsprite origin
Trigger Once

Wait 1 Second
create enemy bullet at enemy position
wait 2 sec
delete bullet bc its of screen

and the pathfinding code is move enemy to sprite origin 70

this is how the game looks and its supposed to shoot me not just stand there

here is the game so you can see what i am talking about
Game Link only works for 24hr

Maybe instead of the “trigger once”, use a timer condition corresponding to the fire rate.

1 Like

Maybe try [ move enemy to RandomInRange(newsprite.pointX(¨origin¨),500);70 ] or something like that, you can choose whatever the second X coordinate is… And might need to use the “Repeat” for each instance.

For the firing issue one thing I’d try is something like
The x position of enemy > newsprite.X() - 20
The x position of enemy < newsprite.X() + 20

Just to see if the fire triggers if you give it a wider range

1 Like

thanks for the help
and how do i make this post resolved or somthing similar so noboddy else goes here and tries to help because it works now

Nice. :+1:
Simply edit the title (pencil icon) and add the [Solved] tag.