Enemy AI

This week I have started to create the Enemy in my game.  Once again, I have chosen to use a simple box shape for the graphics of my enemy so I can concentrate on the movement without adding in animations.

I have created a C# script called EnemyController to control the movement of the enemy.

When I first started to create the enemy, I placed several waypoints around the environment and had it wandering randomly between waypoints to give the illusion that it was wandering randomly around the environment. However, I have now developed the enemy script so that the enemy actually wanders randomly around the environment. I did this by creating a single waypoint and have it change position to a completely random position in the environment when the enemy gets within a certain distance of it.

EnemyController script:

Screenshot 2018-12-16 at 20.36.20.pngScreenshot 2018-12-16 at 20.38.38

Leave a comment