How do I make a AI that follow the player

I need this so that I can make a shooter game

I did this once but I forgot how to

A simple way of going about it would be to change the x/y values of the AI based on the player’s x/y values, like this:
followPlayer.wick (2.0 KB)
You can move the blue circle around with the arrow keys and the green circle follows it.

In the update script for the green circle, its x and y increase or decrease based on the player’s x and y. To adjust the speed, you just go to the default script of the main timeline frame, and change the AIspeed variable:

AIspeed=4;

(a smaller number would make it slower, a bigger number would make it faster)

2 Likes

this is a repeated topic. there’s already an answer for you.

2 Likes

thanks mate

I knew there had to be something like this already, for some reason I didn’t see it at all when searching in the forum earlier…I guess because I used the search terms “follow player” instead of “follow character”.

1 Like