How to make enemy AI that can shoot and chase after player?

Once again, I’m working on another project again. This time, I want to finish a single project first before going for another new project. Also, the project is a Top Down Shooter, I’ve added my player character and an enemy with three different sprites that represents three additional enemies from a single object. I managed to make my player character shoot using the Fire A Bullet behavior and also add said behavior to my enemy object, too. The first problem is, how do I make the enemy shoot and chase after my player character?

I have finally make the enemy shoot at the player, but I haven’t yet make the enemy chasing the player. Please help.

Take a look at the built in “Basic AI with pathfinding” example. It has a few different examples of top down enemies that follow the player.

1 Like

Sorry, but, it’s too complex and I’m not quite familiar with variables. Is there another way?

No not really. The pathfinding behavior was created to simplify this in general, and the examples in the engine show some ways to use it.

The only other way would be to basically recreate what pathfinding does manually, which is going to involve even more variables and events to begin with.

There are numerous pathfinding examples in the engine, so I recommend reviewing those and the wiki to learn more about implementing it.

If you say so, then I’ll try my best.

1 Like

Maybe distance with objects is easy way do that.