O'Reilly logo

Unity 5.x 2D Game Development Blueprints by Abdelrahman Saher, Francesco Sapio

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Waypoints for enemies

Now, the first thing to finish is how the enemies move around the map. In Chapter 7, Tower Defense Basics, we saw how to script them in order to make them move from one waypoint to another. As a short recap, a waypoint is a special point on the map where the enemies change their direction to move towards another waypoint. They can contain logic to actually lead the character to specific places that change over time, such as next to the player. They can also perform part of the decision-making process. For example, imagine a Tower Defense game where the path of the enemies splits in two. In this case, the waypoints can be used to decide which direction a particular enemy should take. The advantage of waypoints is that, in ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required