Refactoring the 2D enemy systems to 3D with NavMesh
In this chapter, the goal is to guide you through the comprehensive process of bringing this hovering adversary to life, turned against us by the evil plant entity invading our systems. Its mission is to patrol the corridors of the habitat station to prevent the player from eradicating the infestation and getting back to Kryk’zylx normalcy (whatever that is).
Figure 13.1 – Enemy hover bot on patrol
Way back in Chapter 8, for our 2D game, we solved the problem of enemy NPC navigation by using a simple patrol waypoint behavior where the enemy robot moves between two waypoints in 2D space – a left and a right.
Well, we’re going to do something similar here. However, because we’re now working in 3D space and have a more complex floor plan to navigate, we’ll still set up a patrol path using waypoints. Still, we’ll now use Unity’s AI Navigation package...