How to make shooting ai


#1

I want to make ai that goes around and shoots when a player comes in within a certain range.

how can i do that?


#2

Hello Kang,
this is not the exact solution but can help you :
http://wiki.compilgames.net/doku.php/gdevelop5/tutorials/tank-shooter#enemy_ai


#3

I’m sorry but I want to make a pixel 2d game that I see from the side.


#4

Check the distance between the player and the ai object, and then fire at the player if the distance is within a set number of pixels.


#5

Hi, is this what you want? I made this for a game jam. The orange enemy shoots the player if it comes close. Is this the mechanic you want, if yes I will send a screenshot of the code
This is for computer only